Class ImmutableOracleObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableOracleObject
All Implemented Interfaces:
LedgerObject, OracleObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object, which will always be "Oracle" in this case.
      Specified by:
      ledgerEntryType in interface OracleObject
      Returns:
      Always returns LedgerObject.LedgerEntryType.ORACLE.
    • flags

      public Flags flags()
      A bit-map of boolean flags. No flags are defined for OracleObject, so this value is always 0.
      Specified by:
      flags in interface OracleObject
      Returns:
      Always Flags.UNSET.
    • owner

      public Address owner()
      The XRPL account with update and delete privileges for the oracle. It's recommended to set up multi-signing on this account.
      Specified by:
      owner in interface OracleObject
      Returns:
      An Address.
    • provider

      public OracleProvider provider()
      An arbitrary value that identifies an oracle provider, such as Chainlink, Band, or DIA. This field is a string, up to 256 ASCII hex encoded characters (0x20-0x7E).
      Specified by:
      provider in interface OracleObject
      Returns:
      An OracleProvider.
    • priceDataSeries

      public com.google.common.collect.ImmutableList<PriceDataWrapper> priceDataSeries()
      An array of up to 10 PriceData objects, each representing the price information for a token pair. More than five PriceData objects require two owner reserves.
      Specified by:
      priceDataSeries in interface OracleObject
      Returns:
      A List of PriceDataWrapper.
    • assetClass

      public String assetClass()
      Describes the type of asset, such as "currency", "commodity", or "index". This field is a string, up to 16 ASCII hex encoded characters (0x20-0x7E).
      Specified by:
      assetClass in interface OracleObject
      Returns:
      A String.
    • lastUpdateTime

      public com.google.common.primitives.UnsignedInteger lastUpdateTime()
      The time the data was last updated, represented in Unix time.
      Specified by:
      lastUpdateTime in interface OracleObject
      Returns:
      An UnsignedInteger.
    • uri

      public Optional<OracleUri> uri()
      An optional Universal Resource Identifier to reference price data off-chain. This field is limited to 256 bytes.
      Specified by:
      uri in interface OracleObject
      Returns:
      An Optional OracleUri.
    • ownerNode

      public String ownerNode()
      A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.

      Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.

      Specified by:
      ownerNode in interface OracleObject
      Returns:
      A String containing the owner node hint.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface OracleObject
      Returns:
      A Hash256 containing the previous transaction hash.
    • previousTransactionLedgerSequence

      public com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence()
      The index of the ledger that contains the transaction that most recently modified this object.
      Specified by:
      previousTransactionLedgerSequence in interface OracleObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • index

      public Hash256 index()
      The unique ID of the OracleObject.
      Specified by:
      index in interface OracleObject
      Returns:
      A Hash256 containing the ID.
    • withOwner

      public final ImmutableOracleObject withOwner(Address value)
      Copy the current immutable object by setting a value for the owner attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for owner
      Returns:
      A modified copy of the this object
    • withProvider

      public final ImmutableOracleObject withProvider(OracleProvider value)
      Copy the current immutable object by setting a value for the provider attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for provider
      Returns:
      A modified copy of the this object
    • withPriceDataSeries

      public final ImmutableOracleObject withPriceDataSeries(PriceDataWrapper... elements)
      Copy the current immutable object with elements that replace the content of priceDataSeries.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPriceDataSeries

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

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

      public final ImmutableOracleObject withLastUpdateTime(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the lastUpdateTime attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for lastUpdateTime
      Returns:
      A modified copy of the this object
    • withUri

      public final ImmutableOracleObject withUri(OracleUri value)
      Copy the current immutable object by setting a present value for the optional uri attribute.
      Parameters:
      value - The value for uri
      Returns:
      A modified copy of this object
    • withUri

      public final ImmutableOracleObject withUri(Optional<? extends OracleUri> optional)
      Copy the current immutable object by setting an optional value for the uri attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for uri
      Returns:
      A modified copy of this object
    • withOwnerNode

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

      public final ImmutableOracleObject withPreviousTransactionId(Hash256 value)
      Copy the current immutable object by setting a value for the previousTransactionId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionId
      Returns:
      A modified copy of the this object
    • withPreviousTransactionLedgerSequence

      public final ImmutableOracleObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the previousTransactionLedgerSequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionLedgerSequence
      Returns:
      A modified copy of the this object
    • withIndex

      public final ImmutableOracleObject withIndex(Hash256 value)
      Copy the current immutable object by setting a value for the index attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for index
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableOracleObject 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: ledgerEntryType, flags, owner, provider, priceDataSeries, assetClass, lastUpdateTime, uri, ownerNode, previousTransactionId, previousTransactionLedgerSequence, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableOracleObject copyOf(OracleObject instance)
      Creates an immutable copy of a OracleObject 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 OracleObject instance
    • builder

      public static ImmutableOracleObject.Builder builder()
      Creates a builder for ImmutableOracleObject.
       ImmutableOracleObject.builder()
          .owner(org.xrpl.xrpl4j.model.transactions.Address) // required owner
          .provider(org.xrpl.xrpl4j.model.transactions.OracleProvider) // required provider
          .addPriceDataSeries|addAllPriceDataSeries(org.xrpl.xrpl4j.model.transactions.PriceDataWrapper) // priceDataSeries elements
          .assetClass(String) // required assetClass
          .lastUpdateTime(com.google.common.primitives.UnsignedInteger) // required lastUpdateTime
          .uri(org.xrpl.xrpl4j.model.transactions.OracleUri) // optional uri
          .ownerNode(String) // required ownerNode
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableOracleObject builder