Share via


Filter Class

  • java.lang.Object
    • com.azure.resourcemanager.eventgrid.models.Filter

Implements

public class Filter
implements JsonSerializable<Filter>

This is the base type that represents a filter. To configure a filter, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsFilter, NumberInFilter etc depending on the type of the key based on which you want to filter.

Constructor Summary

Constructor Description
Filter()

Creates an instance of Filter class.

Method Summary

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

Reads an instance of Filter from the JsonReader.

String key()

Get the key property: The field/property in the event based on which you want to filter.

FilterOperatorType operatorType()

Get the operatorType property: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Filter withKey(String key)

Set the key property: The field/property in the event based on which you want to filter.

Methods inherited from java.lang.Object

Constructor Details

Filter

public Filter()

Creates an instance of Filter class.

Method Details

fromJson

public static Filter fromJson(JsonReader jsonReader)

Reads an instance of Filter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

Throws:

IOException

- If an error occurs while reading the Filter.

key

public String key()

Get the key property: The field/property in the event based on which you want to filter.

Returns:

the key value.

operatorType

public FilterOperatorType operatorType()

Get the operatorType property: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.

Returns:

the operatorType value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withKey

public Filter withKey(String key)

Set the key property: The field/property in the event based on which you want to filter.

Parameters:

key - the key value to set.

Returns:

the Filter object itself.

Applies to