TimeWindowCustomAlertRule Class

public class TimeWindowCustomAlertRule
extends ThresholdCustomAlertRule

A custom alert rule that checks if the number of activities (depends on the custom alert type) in a time window is within the given range.

Constructor Summary

Constructor Description
TimeWindowCustomAlertRule()

Creates an instance of TimeWindowCustomAlertRule class.

Method Summary

Modifier and Type Method and Description
static TimeWindowCustomAlertRule fromJson(JsonReader jsonReader)

Reads an instance of TimeWindowCustomAlertRule from the JsonReader.

String ruleType()

Get the ruleType property: The type of the custom alert rule.

Duration timeWindowSize()

Get the timeWindowSize property: The time window size in iso8601 format.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

TimeWindowCustomAlertRule withIsEnabled(boolean isEnabled)

Set the isEnabled property: Status of the custom alert.

TimeWindowCustomAlertRule withMaxThreshold(int maxThreshold)

Set the maxThreshold property: The maximum threshold.

TimeWindowCustomAlertRule withMinThreshold(int minThreshold)

Set the minThreshold property: The minimum threshold.

TimeWindowCustomAlertRule withTimeWindowSize(Duration timeWindowSize)

Set the timeWindowSize property: The time window size in iso8601 format.

Methods inherited from CustomAlertRule

Methods inherited from ThresholdCustomAlertRule

Methods inherited from java.lang.Object

Constructor Details

TimeWindowCustomAlertRule

public TimeWindowCustomAlertRule()

Creates an instance of TimeWindowCustomAlertRule class.

Method Details

fromJson

public static TimeWindowCustomAlertRule fromJson(JsonReader jsonReader)

Reads an instance of TimeWindowCustomAlertRule from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of TimeWindowCustomAlertRule 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.

ruleType

public String ruleType()

Get the ruleType property: The type of the custom alert rule.

Overrides:

TimeWindowCustomAlertRule.ruleType()

Returns:

the ruleType value.

timeWindowSize

public Duration timeWindowSize()

Get the timeWindowSize property: The time window size in iso8601 format.

Returns:

the timeWindowSize value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

TimeWindowCustomAlertRule.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

TimeWindowCustomAlertRule.validate()

withIsEnabled

public TimeWindowCustomAlertRule withIsEnabled(boolean isEnabled)

Set the isEnabled property: Status of the custom alert.

Overrides:

TimeWindowCustomAlertRule.withIsEnabled(boolean isEnabled)

Parameters:

isEnabled

withMaxThreshold

public TimeWindowCustomAlertRule withMaxThreshold(int maxThreshold)

Set the maxThreshold property: The maximum threshold.

Overrides:

TimeWindowCustomAlertRule.withMaxThreshold(int maxThreshold)

Parameters:

maxThreshold

withMinThreshold

public TimeWindowCustomAlertRule withMinThreshold(int minThreshold)

Set the minThreshold property: The minimum threshold.

Overrides:

TimeWindowCustomAlertRule.withMinThreshold(int minThreshold)

Parameters:

minThreshold

withTimeWindowSize

public TimeWindowCustomAlertRule withTimeWindowSize(Duration timeWindowSize)

Set the timeWindowSize property: The time window size in iso8601 format.

Parameters:

timeWindowSize - the timeWindowSize value to set.

Returns:

the TimeWindowCustomAlertRule object itself.

Applies to