Class ImmutablePriceData.Builder

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutablePriceData.Builder
Enclosing class:
ImmutablePriceData

@NotThreadSafe public static final class ImmutablePriceData.Builder extends Object
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 Details

    • from

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder from(PriceData instance)
      Fill a builder with attribute values from the provided PriceData instance. 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:
      this builder for use in a chained invocation
    • baseAsset

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder baseAsset(String baseAsset)
      Initializes the value for the baseAsset attribute.
      Parameters:
      baseAsset - The value for baseAsset
      Returns:
      this builder for use in a chained invocation
    • quoteAsset

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder quoteAsset(String quoteAsset)
      Initializes the value for the quoteAsset attribute.
      Parameters:
      quoteAsset - The value for quoteAsset
      Returns:
      this builder for use in a chained invocation
    • assetPrice

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder assetPrice(AssetPrice assetPrice)
      Initializes the optional value assetPrice to assetPrice.
      Parameters:
      assetPrice - The value for assetPrice
      Returns:
      this builder for chained invocation
    • assetPrice

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder assetPrice(Optional<? extends AssetPrice> assetPrice)
      Initializes the optional value assetPrice to assetPrice.
      Parameters:
      assetPrice - The value for assetPrice
      Returns:
      this builder for use in a chained invocation
    • scale

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder scale(com.google.common.primitives.UnsignedInteger scale)
      Initializes the optional value scale to scale.
      Parameters:
      scale - The value for scale
      Returns:
      this builder for chained invocation
    • scale

      @CanIgnoreReturnValue public final ImmutablePriceData.Builder scale(Optional<? extends com.google.common.primitives.UnsignedInteger> scale)
      Initializes the optional value scale to scale.
      Parameters:
      scale - The value for scale
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePriceData build()
      Builds a new ImmutablePriceData.
      Returns:
      An immutable instance of PriceData
      Throws:
      IllegalStateException - if any required attributes are missing