Package org.xrpl.xrpl4j.model.ledger
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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableOracleObject.Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionDescribes the type of asset, such as "currency", "commodity", or "index".builder()Creates a builder forImmutableOracleObject.static ImmutableOracleObjectcopyOf(OracleObject instance) Creates an immutable copy of aOracleObjectvalue.booleanThis instance is equal to all instances ofImmutableOracleObjectthat have equal attribute values.flags()A bit-map of boolean flags.inthashCode()Computes a hash code from attributes:ledgerEntryType,flags,owner,provider,priceDataSeries,assetClass,lastUpdateTime,uri,ownerNode,previousTransactionId,previousTransactionLedgerSequence,index.index()The unique ID of theOracleObject.com.google.common.primitives.UnsignedIntegerThe time the data was last updated, represented in Unix time.The type of ledger object, which will always be "Oracle" in this case.owner()The XRPL account with update and delete privileges for the oracle.A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.The identifying hash of the transaction that most recently modified this object.com.google.common.primitives.UnsignedIntegerThe index of the ledger that contains the transaction that most recently modified this object.com.google.common.collect.ImmutableList<PriceDataWrapper> An array of up to 10 PriceData objects, each representing the price information for a token pair.provider()An arbitrary value that identifies an oracle provider, such as Chainlink, Band, or DIA.toString()Prints the immutable valueOracleObjectwith attribute values.uri()An optional Universal Resource Identifier to reference price data off-chain.final ImmutableOracleObjectwithAssetClass(String value) Copy the current immutable object by setting a value for theassetClassattribute.final ImmutableOracleObjectCopy the current immutable object by setting a value for theindexattribute.final ImmutableOracleObjectwithLastUpdateTime(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thelastUpdateTimeattribute.final ImmutableOracleObjectCopy the current immutable object by setting a value for theownerattribute.final ImmutableOracleObjectwithOwnerNode(String value) Copy the current immutable object by setting a value for theownerNodeattribute.final ImmutableOracleObjectwithPreviousTransactionId(Hash256 value) Copy the current immutable object by setting a value for thepreviousTransactionIdattribute.final ImmutableOracleObjectwithPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute.final ImmutableOracleObjectwithPriceDataSeries(Iterable<? extends PriceDataWrapper> elements) Copy the current immutable object with elements that replace the content ofpriceDataSeries.final ImmutableOracleObjectwithPriceDataSeries(PriceDataWrapper... elements) Copy the current immutable object with elements that replace the content ofpriceDataSeries.final ImmutableOracleObjectwithProvider(OracleProvider value) Copy the current immutable object by setting a value for theproviderattribute.final ImmutableOracleObjectCopy the current immutable object by setting an optional value for theuriattribute.final ImmutableOracleObjectCopy the current immutable object by setting a present value for the optionaluriattribute.
-
Method Details
-
ledgerEntryType
The type of ledger object, which will always be "Oracle" in this case.- Specified by:
ledgerEntryTypein interfaceOracleObject- Returns:
- Always returns
LedgerObject.LedgerEntryType.ORACLE.
-
flags
A bit-map of boolean flags. No flags are defined forOracleObject, so this value is always 0.- Specified by:
flagsin interfaceOracleObject- Returns:
- Always
Flags.UNSET.
-
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:
ownerin interfaceOracleObject- Returns:
- An
Address.
-
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:
providerin interfaceOracleObject- Returns:
- An
OracleProvider.
-
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:
priceDataSeriesin interfaceOracleObject- Returns:
- A
ListofPriceDataWrapper.
-
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:
assetClassin interfaceOracleObject- Returns:
- A
String.
-
lastUpdateTime
public com.google.common.primitives.UnsignedInteger lastUpdateTime()The time the data was last updated, represented in Unix time.- Specified by:
lastUpdateTimein interfaceOracleObject- Returns:
- An
UnsignedInteger.
-
uri
An optional Universal Resource Identifier to reference price data off-chain. This field is limited to 256 bytes.- Specified by:
uriin interfaceOracleObject- Returns:
- An
OptionalOracleUri.
-
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:
ownerNodein interfaceOracleObject- Returns:
- A
Stringcontaining the owner node hint.
-
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTransactionIdin interfaceOracleObject- Returns:
- A
Hash256containing 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:
previousTransactionLedgerSequencein interfaceOracleObject- Returns:
- An
UnsignedIntegerrepresenting the previous transaction ledger sequence.
-
index
The unique ID of theOracleObject.- Specified by:
indexin interfaceOracleObject- Returns:
- A
Hash256containing the ID.
-
withOwner
Copy the current immutable object by setting a value for theownerattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for owner- Returns:
- A modified copy of the
thisobject
-
withProvider
Copy the current immutable object by setting a value for theproviderattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for provider- Returns:
- A modified copy of the
thisobject
-
withPriceDataSeries
Copy the current immutable object with elements that replace the content ofpriceDataSeries.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPriceDataSeries
public final ImmutableOracleObject withPriceDataSeries(Iterable<? extends PriceDataWrapper> elements) Copy the current immutable object with elements that replace the content ofpriceDataSeries. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of priceDataSeries elements to set- Returns:
- A modified copy of
thisobject
-
withAssetClass
Copy the current immutable object by setting a value for theassetClassattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for assetClass- Returns:
- A modified copy of the
thisobject
-
withLastUpdateTime
public final ImmutableOracleObject withLastUpdateTime(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thelastUpdateTimeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for lastUpdateTime- Returns:
- A modified copy of the
thisobject
-
withUri
Copy the current immutable object by setting a present value for the optionaluriattribute.- Parameters:
value- The value for uri- Returns:
- A modified copy of
thisobject
-
withUri
Copy the current immutable object by setting an optional value for theuriattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for uri- Returns:
- A modified copy of
thisobject
-
withOwnerNode
Copy the current immutable object by setting a value for theownerNodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ownerNode- Returns:
- A modified copy of the
thisobject
-
withPreviousTransactionId
Copy the current immutable object by setting a value for thepreviousTransactionIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTransactionId- Returns:
- A modified copy of the
thisobject
-
withPreviousTransactionLedgerSequence
public final ImmutableOracleObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTransactionLedgerSequence- Returns:
- A modified copy of the
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableOracleObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,flags,owner,provider,priceDataSeries,assetClass,lastUpdateTime,uri,ownerNode,previousTransactionId,previousTransactionLedgerSequence,index. -
toString
Prints the immutable valueOracleObjectwith attribute values. -
copyOf
Creates an immutable copy of aOracleObjectvalue. 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
Creates a builder forImmutableOracleObject.ImmutableOracleObject.builder() .owner(org.xrpl.xrpl4j.model.transactions.Address) // requiredowner.provider(org.xrpl.xrpl4j.model.transactions.OracleProvider) // requiredprovider.addPriceDataSeries|addAllPriceDataSeries(org.xrpl.xrpl4j.model.transactions.PriceDataWrapper) //priceDataSerieselements .assetClass(String) // requiredassetClass.lastUpdateTime(com.google.common.primitives.UnsignedInteger) // requiredlastUpdateTime.uri(org.xrpl.xrpl4j.model.transactions.OracleUri) // optionaluri.ownerNode(String) // requiredownerNode.previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredpreviousTransactionId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // requiredpreviousTransactionLedgerSequence.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableOracleObject builder
-