RetentionPolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.models.RetentionPolicy

Implements

public final class RetentionPolicy
implements JsonSerializable<RetentionPolicy>

Specifies the retention policy for the log.

Constructor Summary

Constructor Description
RetentionPolicy()

Creates an instance of RetentionPolicy class.

Method Summary

Modifier and Type Method and Description
int days()

Get the days property: the number of days for the retention in days.

boolean enabled()

Get the enabled property: a value indicating whether the retention policy is enabled.

static RetentionPolicy fromJson(JsonReader jsonReader)

Reads an instance of RetentionPolicy from the JsonReader.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

RetentionPolicy withDays(int days)

Set the days property: the number of days for the retention in days.

RetentionPolicy withEnabled(boolean enabled)

Set the enabled property: a value indicating whether the retention policy is enabled.

Methods inherited from java.lang.Object

Constructor Details

RetentionPolicy

public RetentionPolicy()

Creates an instance of RetentionPolicy class.

Method Details

days

public int days()

Get the days property: the number of days for the retention in days. A value of 0 will retain the events indefinitely.

Returns:

the days value.

enabled

public boolean enabled()

Get the enabled property: a value indicating whether the retention policy is enabled.

Returns:

the enabled value.

fromJson

public static RetentionPolicy fromJson(JsonReader jsonReader)

Reads an instance of RetentionPolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of RetentionPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withDays

public RetentionPolicy withDays(int days)

Set the days property: the number of days for the retention in days. A value of 0 will retain the events indefinitely.

Parameters:

days - the days value to set.

Returns:

the RetentionPolicy object itself.

withEnabled

public RetentionPolicy withEnabled(boolean enabled)

Set the enabled property: a value indicating whether the retention policy is enabled.

Parameters:

enabled - the enabled value to set.

Returns:

the RetentionPolicy object itself.

Applies to