Package org.xrpl.xrpl4j.model.ledger
Class ImmutableOfferObject
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableOfferObject
- All Implemented Interfaces:
LedgerObject,OfferObject
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableOfferObject
extends Object
implements OfferObject
Immutable implementation of
OfferObject.
Use the builder to create immutable instances:
ImmutableOfferObject.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableOfferObject.Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionaccount()The sender of theOfferObject.com.google.common.collect.ImmutableList<BookWrapper> An additional list of order book directories that this offer belongs to.The ID of the Offer Directory that links to this offer.bookNode()A hint indicating which page of the offer directory links to this object, in case the directory consists of multiple pages.static ImmutableOfferObject.Builderbuilder()Creates a builder forImmutableOfferObject.static ImmutableOfferObjectcopyOf(OfferObject instance) Creates an immutable copy of aOfferObjectvalue.domainId()The permissioned domain that the offer is part of.booleanThis instance is equal to all instances ofImmutableOfferObjectthat have equal attribute values.Optional<com.google.common.primitives.UnsignedInteger> Indicates the time after which this offer is considered expired, in seconds since the Ripple Epoch.flags()A bit-map of boolean flags.inthashCode()Computes a hash code from attributes:ledgerEntryType,account,flags,sequence,takerPays,takerGets,bookDirectory,bookNode,ownerNode,previousTransactionId,previousTransactionLedgerSequence,expiration,domainId,additionalBooks,index.index()The unique ID of theOfferObject.The value 0x006F, mapped to the string "Offer", indicates that this object is aOfferObjectobject.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.primitives.UnsignedIntegersequence()The sequence number of theOfferCreatetransaction that created this offer.The remaining amount and type of currency being provided by the offer creator.The remaining amount and type of currency requested by the offer creator.toString()Prints the immutable valueOfferObjectwith attribute values.final ImmutableOfferObjectwithAccount(Address value) Copy the current immutable object by setting a value for theaccountattribute.final ImmutableOfferObjectwithAdditionalBooks(Iterable<? extends BookWrapper> elements) Copy the current immutable object with elements that replace the content ofadditionalBooks.final ImmutableOfferObjectwithAdditionalBooks(BookWrapper... elements) Copy the current immutable object with elements that replace the content ofadditionalBooks.final ImmutableOfferObjectwithBookDirectory(Hash256 value) Copy the current immutable object by setting a value for thebookDirectoryattribute.final ImmutableOfferObjectwithBookNode(String value) Copy the current immutable object by setting a value for thebookNodeattribute.final ImmutableOfferObjectwithDomainId(Optional<? extends Hash256> optional) Copy the current immutable object by setting an optional value for thedomainIdattribute.final ImmutableOfferObjectwithDomainId(Hash256 value) Copy the current immutable object by setting a present value for the optionaldomainIdattribute.final ImmutableOfferObjectwithExpiration(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalexpirationattribute.final ImmutableOfferObjectwithExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for theexpirationattribute.final ImmutableOfferObjectwithFlags(OfferFlags value) Copy the current immutable object by setting a value for theflagsattribute.final ImmutableOfferObjectCopy the current immutable object by setting a value for theindexattribute.final ImmutableOfferObjectwithOwnerNode(String value) Copy the current immutable object by setting a value for theownerNodeattribute.final ImmutableOfferObjectwithPreviousTransactionId(Hash256 value) Copy the current immutable object by setting a value for thepreviousTransactionIdattribute.final ImmutableOfferObjectwithPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute.final ImmutableOfferObjectwithSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thesequenceattribute.final ImmutableOfferObjectwithTakerGets(CurrencyAmount value) Copy the current immutable object by setting a value for thetakerGetsattribute.final ImmutableOfferObjectwithTakerPays(CurrencyAmount value) Copy the current immutable object by setting a value for thetakerPaysattribute.
-
Method Details
-
ledgerEntryType
The value 0x006F, mapped to the string "Offer", indicates that this object is aOfferObjectobject.- Specified by:
ledgerEntryTypein interfaceOfferObject- Returns:
- Always
LedgerObject.LedgerEntryType.OFFER.
-
account
The sender of theOfferObject. Cashing theOfferObjectdebits this address's balance.- Specified by:
accountin interfaceOfferObject- Returns:
- The
Addressof the offer sender.
-
flags
A bit-map of boolean flags.- Specified by:
flagsin interfaceOfferObject- Returns:
- A
OfferFlags.
-
sequence
public com.google.common.primitives.UnsignedInteger sequence()The sequence number of theOfferCreatetransaction that created this offer.- Specified by:
sequencein interfaceOfferObject- Returns:
- An
UnsignedIntegerrepresenting the sequence number.
-
takerPays
The remaining amount and type of currency requested by the offer creator.- Specified by:
takerPaysin interfaceOfferObject- Returns:
- A
CurrencyAmount.
-
takerGets
The remaining amount and type of currency being provided by the offer creator.- Specified by:
takerGetsin interfaceOfferObject- Returns:
- A
CurrencyAmount.
-
bookDirectory
The ID of the Offer Directory that links to this offer.- Specified by:
bookDirectoryin interfaceOfferObject- Returns:
- A
Hash256containing the ID.
-
bookNode
A hint indicating which page of the offer directory links to this object, in case the directory consists of multiple pages.- Specified by:
bookNodein interfaceOfferObject- Returns:
- A
Stringcontaining the hint.
-
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 interfaceOfferObject- Returns:
- A
Stringcontaining the hint.
-
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTransactionIdin interfaceOfferObject- 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 interfaceOfferObject- Returns:
- An
UnsignedIntegerrepresenting the previous transaction ledger sequence.
-
expiration
Indicates the time after which this offer is considered expired, in seconds since the Ripple Epoch.- Specified by:
expirationin interfaceOfferObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the expiration of this offer.
-
domainId
The permissioned domain that the offer is part of.- Specified by:
domainIdin interfaceOfferObject- Returns:
- A
Hash256representing DomainID.
-
additionalBooks
An additional list of order book directories that this offer belongs to. Currently, this field only applicable to hybrid offers.- Specified by:
additionalBooksin interfaceOfferObject- Returns:
- A list of
BookWrapperrepresenting order book directories.
-
index
The unique ID of theOfferObject.- Specified by:
indexin interfaceOfferObject- Returns:
- A
Hash256containing the ID.
-
withAccount
Copy the current immutable object by setting a value for theaccountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for account- Returns:
- A modified copy of the
thisobject
-
withFlags
Copy the current immutable object by setting a value for theflagsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for flags- Returns:
- A modified copy of the
thisobject
-
withSequence
Copy the current immutable object by setting a value for thesequenceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sequence- Returns:
- A modified copy of the
thisobject
-
withTakerPays
Copy the current immutable object by setting a value for thetakerPaysattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for takerPays- Returns:
- A modified copy of the
thisobject
-
withTakerGets
Copy the current immutable object by setting a value for thetakerGetsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for takerGets- Returns:
- A modified copy of the
thisobject
-
withBookDirectory
Copy the current immutable object by setting a value for thebookDirectoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bookDirectory- Returns:
- A modified copy of the
thisobject
-
withBookNode
Copy the current immutable object by setting a value for thebookNodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bookNode- Returns:
- A modified copy of the
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 ImmutableOfferObject 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
-
withExpiration
public final ImmutableOfferObject withExpiration(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalexpirationattribute.- Parameters:
value- The value for expiration- Returns:
- A modified copy of
thisobject
-
withExpiration
public final ImmutableOfferObject withExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for theexpirationattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for expiration- Returns:
- A modified copy of
thisobject
-
withDomainId
Copy the current immutable object by setting a present value for the optionaldomainIdattribute.- Parameters:
value- The value for domainId- Returns:
- A modified copy of
thisobject
-
withDomainId
Copy the current immutable object by setting an optional value for thedomainIdattribute. 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 domainId- Returns:
- A modified copy of
thisobject
-
withAdditionalBooks
Copy the current immutable object with elements that replace the content ofadditionalBooks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAdditionalBooks
Copy the current immutable object with elements that replace the content ofadditionalBooks. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of additionalBooks elements to set- Returns:
- A modified copy of
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 ofImmutableOfferObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,account,flags,sequence,takerPays,takerGets,bookDirectory,bookNode,ownerNode,previousTransactionId,previousTransactionLedgerSequence,expiration,domainId,additionalBooks,index. -
toString
Prints the immutable valueOfferObjectwith attribute values. -
copyOf
Creates an immutable copy of aOfferObjectvalue. 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 OfferObject instance
-
builder
Creates a builder forImmutableOfferObject.ImmutableOfferObject.builder() .account(org.xrpl.xrpl4j.model.transactions.Address) // requiredaccount.flags(org.xrpl.xrpl4j.model.flags.OfferFlags) // requiredflags.sequence(com.google.common.primitives.UnsignedInteger) // requiredsequence.takerPays(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // requiredtakerPays.takerGets(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // requiredtakerGets.bookDirectory(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredbookDirectory.bookNode(String) // requiredbookNode.ownerNode(String) // requiredownerNode.previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredpreviousTransactionId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // requiredpreviousTransactionLedgerSequence.expiration(com.google.common.primitives.UnsignedInteger) // optionalexpiration.domainId(org.xrpl.xrpl4j.model.transactions.Hash256) // optionaldomainId.addAdditionalBooks|addAllAdditionalBooks(org.xrpl.xrpl4j.model.ledger.BookWrapper) //additionalBookselements .index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableOfferObject builder
-