Partager via


ResourceSelector Class

  • java.lang.Object
    • com.azure.resourcemanager.resources.models.ResourceSelector

Implements

public final class ResourceSelector
implements JsonSerializable<ResourceSelector>

The resource selector to filter policies by resource properties.

Constructor Summary

Constructor Description
ResourceSelector()

Creates an instance of ResourceSelector class.

Method Summary

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

Reads an instance of ResourceSelector from the JsonReader.

String name()

Get the name property: The name of the resource selector.

List<Selector> selectors()

Get the selectors property: The list of the selector expressions.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ResourceSelector withName(String name)

Set the name property: The name of the resource selector.

ResourceSelector withSelectors(List<Selector> selectors)

Set the selectors property: The list of the selector expressions.

Methods inherited from java.lang.Object

Constructor Details

ResourceSelector

public ResourceSelector()

Creates an instance of ResourceSelector class.

Method Details

fromJson

public static ResourceSelector fromJson(JsonReader jsonReader)

Reads an instance of ResourceSelector from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

name

public String name()

Get the name property: The name of the resource selector.

Returns:

the name value.

selectors

public List selectors()

Get the selectors property: The list of the selector expressions.

Returns:

the selectors value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withName

public ResourceSelector withName(String name)

Set the name property: The name of the resource selector.

Parameters:

name - the name value to set.

Returns:

the ResourceSelector object itself.

withSelectors

public ResourceSelector withSelectors(List selectors)

Set the selectors property: The list of the selector expressions.

Parameters:

selectors - the selectors value to set.

Returns:

the ResourceSelector object itself.

Applies to