Class ImmutableGetAggregatePriceRequestParams

java.lang.Object
org.xrpl.xrpl4j.model.client.oracle.ImmutableGetAggregatePriceRequestParams
All Implemented Interfaces:
GetAggregatePriceRequestParams, XrplRequestParams

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableGetAggregatePriceRequestParams extends Object implements GetAggregatePriceRequestParams
Immutable implementation of GetAggregatePriceRequestParams.

Use the builder to create immutable instances: ImmutableGetAggregatePriceRequestParams.builder().

  • Method Details

    • ledgerSpecifier

      public LedgerSpecifier ledgerSpecifier()
      Specifies the ledger version to request. A ledger version can be specified by ledger hash, numerical ledger index, or a shortcut value.
      Specified by:
      ledgerSpecifier in interface GetAggregatePriceRequestParams
      Returns:
      A LedgerSpecifier specifying the ledger version to request.
    • baseAsset

      public String baseAsset()
      The currency code of the asset to be priced.
      Specified by:
      baseAsset in interface GetAggregatePriceRequestParams
      Returns:
      A String.
    • quoteAsset

      public String quoteAsset()
      The currency code of the asset to quote the price of the base asset.
      Specified by:
      quoteAsset in interface GetAggregatePriceRequestParams
      Returns:
      A String.
    • trim

      public Optional<com.google.common.primitives.UnsignedInteger> trim()
      The percentage of outliers to trim. Valid trim range is 1-25. If included, the API returns statistics for the trimmed mean.
      Specified by:
      trim in interface GetAggregatePriceRequestParams
      Returns:
      An Optional UnsignedInteger.
    • trimThreshold

      public Optional<com.google.common.primitives.UnsignedInteger> trimThreshold()
      Defines a time range in seconds for filtering out older price data. Default value is 0, which doesn't filter any data.
      Specified by:
      trimThreshold in interface GetAggregatePriceRequestParams
      Returns:
      An Optional UnsignedInteger.
    • oracles

      public com.google.common.collect.ImmutableList<OracleLedgerEntryParams> oracles()
      A list of oracle identifiers.
      Specified by:
      oracles in interface GetAggregatePriceRequestParams
      Returns:
      A List of OracleLedgerEntryParams.
    • withLedgerSpecifier

      public final ImmutableGetAggregatePriceRequestParams withLedgerSpecifier(LedgerSpecifier value)
      Copy the current immutable object by setting a value for the ledgerSpecifier attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ledgerSpecifier
      Returns:
      A modified copy of the this object
    • withBaseAsset

      public final ImmutableGetAggregatePriceRequestParams withBaseAsset(String value)
      Copy the current immutable object by setting a value for the baseAsset attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for baseAsset
      Returns:
      A modified copy of the this object
    • withQuoteAsset

      public final ImmutableGetAggregatePriceRequestParams withQuoteAsset(String value)
      Copy the current immutable object by setting a value for the quoteAsset attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for quoteAsset
      Returns:
      A modified copy of the this object
    • withTrim

      public final ImmutableGetAggregatePriceRequestParams withTrim(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional trim attribute.
      Parameters:
      value - The value for trim
      Returns:
      A modified copy of this object
    • withTrim

      public final ImmutableGetAggregatePriceRequestParams withTrim(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the trim attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for trim
      Returns:
      A modified copy of this object
    • withTrimThreshold

      public final ImmutableGetAggregatePriceRequestParams withTrimThreshold(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional trimThreshold attribute.
      Parameters:
      value - The value for trimThreshold
      Returns:
      A modified copy of this object
    • withTrimThreshold

      public final ImmutableGetAggregatePriceRequestParams withTrimThreshold(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the trimThreshold attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for trimThreshold
      Returns:
      A modified copy of this object
    • withOracles

      public final ImmutableGetAggregatePriceRequestParams withOracles(OracleLedgerEntryParams... elements)
      Copy the current immutable object with elements that replace the content of oracles.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withOracles

      public final ImmutableGetAggregatePriceRequestParams withOracles(Iterable<? extends OracleLedgerEntryParams> elements)
      Copy the current immutable object with elements that replace the content of oracles. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of oracles elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableGetAggregatePriceRequestParams that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: ledgerSpecifier, baseAsset, quoteAsset, trim, trimThreshold, oracles.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value GetAggregatePriceRequestParams with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a GetAggregatePriceRequestParams value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable GetAggregatePriceRequestParams instance
    • builder

      Creates a builder for ImmutableGetAggregatePriceRequestParams.
       ImmutableGetAggregatePriceRequestParams.builder()
          .ledgerSpecifier(org.xrpl.xrpl4j.model.client.common.LedgerSpecifier) // required ledgerSpecifier
          .baseAsset(String) // required baseAsset
          .quoteAsset(String) // required quoteAsset
          .trim(com.google.common.primitives.UnsignedInteger) // optional trim
          .trimThreshold(com.google.common.primitives.UnsignedInteger) // optional trimThreshold
          .addOracles|addAllOracles(org.xrpl.xrpl4j.model.client.ledger.OracleLedgerEntryParams) // oracles elements
          .build();
       
      Returns:
      A new ImmutableGetAggregatePriceRequestParams builder