Class MetricDimension
java.lang.Object
com.azure.resourcemanager.monitor.models.MetricDimension
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MetricDimension>
public final class MetricDimension
extends Object
implements com.azure.json.JsonSerializable<MetricDimension>
Specifies a metric dimension.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricDimension
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MetricDimension from the JsonReader.name()
Get the name property: Name of the dimension.operator()
Get the operator property: the dimension operator.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.values()
Get the values property: list of dimension values.Set the name property: Name of the dimension.withOperator
(String operator) Set the operator property: the dimension operator.withValues
(List<String> values) Set the values property: list of dimension values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MetricDimension
public MetricDimension()Creates an instance of MetricDimension class.
-
-
Method Details
-
name
Get the name property: Name of the dimension.- Returns:
- the name value.
-
withName
Set the name property: Name of the dimension.- Parameters:
name
- the name value to set.- Returns:
- the MetricDimension object itself.
-
operator
Get the operator property: the dimension operator. Only 'Include' and 'Exclude' are supported.- Returns:
- the operator value.
-
withOperator
Set the operator property: the dimension operator. Only 'Include' and 'Exclude' are supported.- Parameters:
operator
- the operator value to set.- Returns:
- the MetricDimension object itself.
-
values
Get the values property: list of dimension values.- Returns:
- the values value.
-
withValues
Set the values property: list of dimension values.- Parameters:
values
- the values value to set.- Returns:
- the MetricDimension object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<MetricDimension>
- Throws:
IOException
-
fromJson
Reads an instance of MetricDimension from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of MetricDimension if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the MetricDimension.
-