Commitment Class

public final class Commitment
extends Price

Commitment towards the benefit.

Constructor Summary

Constructor Description
Commitment()

Creates an instance of Commitment class.

Method Summary

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

Reads an instance of Commitment from the JsonReader.

CommitmentGrain grain()

Get the grain property: Commitment grain.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Commitment withAmount(Double amount)

Set the amount property: The amount property.

Commitment withCurrencyCode(String currencyCode)

Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record.

Commitment withGrain(CommitmentGrain grain)

Set the grain property: Commitment grain.

Methods inherited from Price

Methods inherited from java.lang.Object

Constructor Details

Commitment

public Commitment()

Creates an instance of Commitment class.

Method Details

fromJson

public static Commitment fromJson(JsonReader jsonReader)

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.

grain

public CommitmentGrain grain()

Get the grain property: Commitment grain.

Returns:

the grain value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

Commitment.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

Commitment.validate()

withAmount

public Commitment withAmount(Double amount)

Set the amount property: The amount property.

Overrides:

Commitment.withAmount(Double amount)

Parameters:

amount

withCurrencyCode

public Commitment withCurrencyCode(String currencyCode)

Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record.

Overrides:

Commitment.withCurrencyCode(String currencyCode)

Parameters:

currencyCode

withGrain

public Commitment withGrain(CommitmentGrain grain)

Set the grain property: Commitment grain.

Parameters:

grain - the grain value to set.

Returns:

the Commitment object itself.

Applies to