Class ImmutablePriceData.Builder
java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutablePriceData.Builder
- Enclosing class:
ImmutablePriceData
Builds instances of type
ImmutablePriceData.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionassetPrice(Optional<? extends AssetPrice> assetPrice) Initializes the optional valueassetPriceto assetPrice.assetPrice(AssetPrice assetPrice) Initializes the optional valueassetPriceto assetPrice.Initializes the value for thebaseAssetattribute.build()Builds a newImmutablePriceData.Fill a builder with attribute values from the providedPriceDatainstance.quoteAsset(String quoteAsset) Initializes the value for thequoteAssetattribute.scale(com.google.common.primitives.UnsignedInteger scale) Initializes the optional valuescaleto scale.Initializes the optional valuescaleto scale.
-
Method Details
-
from
Fill a builder with attribute values from the providedPriceDatainstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
baseAsset
Initializes the value for thebaseAssetattribute.- Parameters:
baseAsset- The value for baseAsset- Returns:
thisbuilder for use in a chained invocation
-
quoteAsset
Initializes the value for thequoteAssetattribute.- Parameters:
quoteAsset- The value for quoteAsset- Returns:
thisbuilder for use in a chained invocation
-
assetPrice
Initializes the optional valueassetPriceto assetPrice.- Parameters:
assetPrice- The value for assetPrice- Returns:
thisbuilder for chained invocation
-
assetPrice
@CanIgnoreReturnValue public final ImmutablePriceData.Builder assetPrice(Optional<? extends AssetPrice> assetPrice) Initializes the optional valueassetPriceto assetPrice.- Parameters:
assetPrice- The value for assetPrice- Returns:
thisbuilder for use in a chained invocation
-
scale
@CanIgnoreReturnValue public final ImmutablePriceData.Builder scale(com.google.common.primitives.UnsignedInteger scale) Initializes the optional valuescaleto scale.- Parameters:
scale- The value for scale- Returns:
thisbuilder for chained invocation
-
scale
@CanIgnoreReturnValue public final ImmutablePriceData.Builder scale(Optional<? extends com.google.common.primitives.UnsignedInteger> scale) Initializes the optional valuescaleto scale.- Parameters:
scale- The value for scale- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutablePriceData.- Returns:
- An immutable instance of PriceData
- Throws:
IllegalStateException- if any required attributes are missing
-