Class Commitment
java.lang.Object
com.azure.resourcemanager.reservations.models.Price
com.azure.resourcemanager.reservations.models.Commitment
- All Implemented Interfaces:
com.azure.json.JsonSerializable<Price>
Commitment towards the benefit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Commitment
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of Commitment from the JsonReader.grain()
Get the grain property: Commitment grain.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withAmount
(Double amount) Set the amount property: The amount property.withCurrencyCode
(String currencyCode) Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record.withGrain
(CommitmentGrain grain) Set the grain property: Commitment grain.Methods inherited from class com.azure.resourcemanager.reservations.models.Price
amount, currencyCode
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
-
Commitment
public Commitment()Creates an instance of Commitment class.
-
-
Method Details
-
grain
Get the grain property: Commitment grain.- Returns:
- the grain value.
-
withGrain
Set the grain property: Commitment grain.- Parameters:
grain
- the grain value to set.- Returns:
- the Commitment object itself.
-
withCurrencyCode
Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record.- Overrides:
withCurrencyCode
in classPrice
- Parameters:
currencyCode
- the currencyCode value to set.- Returns:
- the Price object itself.
-
withAmount
Set the amount property: The amount property.- Overrides:
withAmount
in classPrice
- Parameters:
amount
- the amount value to set.- Returns:
- the Price object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validate
in classPrice
- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<Price>
- Overrides:
toJson
in classPrice
- Throws:
IOException
-
fromJson
Reads an instance of Commitment from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of Commitment 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 Commitment.
-