Package org.xrpl.xrpl4j.model.ledger
Class ImmutableOfferObject.Builder
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableOfferObject.Builder
- Enclosing class:
ImmutableOfferObject
Builds instances of type
ImmutableOfferObject.
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 Summary
Modifier and TypeMethodDescriptionInitializes the value for theaccountattribute.addAdditionalBooks(BookWrapper element) Adds one element toadditionalBookslist.addAdditionalBooks(BookWrapper... elements) Adds elements toadditionalBookslist.addAllAdditionalBooks(Iterable<? extends BookWrapper> elements) Adds elements toadditionalBookslist.additionalBooks(Iterable<? extends BookWrapper> elements) Sets or replaces all elements foradditionalBookslist.bookDirectory(Hash256 bookDirectory) Initializes the value for thebookDirectoryattribute.Initializes the value for thebookNodeattribute.build()Builds a newImmutableOfferObject.Initializes the optional valuedomainIdto domainId.Initializes the optional valuedomainIdto domainId.expiration(com.google.common.primitives.UnsignedInteger expiration) Initializes the optional valueexpirationto expiration.expiration(Optional<? extends com.google.common.primitives.UnsignedInteger> expiration) Initializes the optional valueexpirationto expiration.flags(OfferFlags flags) Initializes the value for theflagsattribute.from(OfferObject instance) Fill a builder with attribute values from the providedOfferObjectinstance.Initializes the value for theindexattribute.Initializes the value for theownerNodeattribute.previousTransactionId(Hash256 previousTransactionId) Initializes the value for thepreviousTransactionIdattribute.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence) Initializes the value for thepreviousTransactionLedgerSequenceattribute.sequence(com.google.common.primitives.UnsignedInteger sequence) Initializes the value for thesequenceattribute.takerGets(CurrencyAmount takerGets) Initializes the value for thetakerGetsattribute.takerPays(CurrencyAmount takerPays) Initializes the value for thetakerPaysattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedOfferObjectinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
account
Initializes the value for theaccountattribute.- Parameters:
account- The value for account- Returns:
thisbuilder for use in a chained invocation
-
flags
Initializes the value for theflagsattribute.- Parameters:
flags- The value for flags- Returns:
thisbuilder for use in a chained invocation
-
sequence
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder sequence(com.google.common.primitives.UnsignedInteger sequence) Initializes the value for thesequenceattribute.- Parameters:
sequence- The value for sequence- Returns:
thisbuilder for use in a chained invocation
-
takerPays
Initializes the value for thetakerPaysattribute.- Parameters:
takerPays- The value for takerPays- Returns:
thisbuilder for use in a chained invocation
-
takerGets
Initializes the value for thetakerGetsattribute.- Parameters:
takerGets- The value for takerGets- Returns:
thisbuilder for use in a chained invocation
-
bookDirectory
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder bookDirectory(Hash256 bookDirectory) Initializes the value for thebookDirectoryattribute.- Parameters:
bookDirectory- The value for bookDirectory- Returns:
thisbuilder for use in a chained invocation
-
bookNode
Initializes the value for thebookNodeattribute.- Parameters:
bookNode- The value for bookNode- Returns:
thisbuilder for use in a chained invocation
-
ownerNode
Initializes the value for theownerNodeattribute.- Parameters:
ownerNode- The value for ownerNode- Returns:
thisbuilder for use in a chained invocation
-
previousTransactionId
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder previousTransactionId(Hash256 previousTransactionId) Initializes the value for thepreviousTransactionIdattribute.- Parameters:
previousTransactionId- The value for previousTransactionId- Returns:
thisbuilder for use in a chained invocation
-
previousTransactionLedgerSequence
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence) Initializes the value for thepreviousTransactionLedgerSequenceattribute.- Parameters:
previousTransactionLedgerSequence- The value for previousTransactionLedgerSequence- Returns:
thisbuilder for use in a chained invocation
-
expiration
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder expiration(com.google.common.primitives.UnsignedInteger expiration) Initializes the optional valueexpirationto expiration.- Parameters:
expiration- The value for expiration- Returns:
thisbuilder for chained invocation
-
expiration
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder expiration(Optional<? extends com.google.common.primitives.UnsignedInteger> expiration) Initializes the optional valueexpirationto expiration.- Parameters:
expiration- The value for expiration- Returns:
thisbuilder for use in a chained invocation
-
domainId
Initializes the optional valuedomainIdto domainId.- Parameters:
domainId- The value for domainId- Returns:
thisbuilder for chained invocation
-
domainId
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder domainId(Optional<? extends Hash256> domainId) Initializes the optional valuedomainIdto domainId.- Parameters:
domainId- The value for domainId- Returns:
thisbuilder for use in a chained invocation
-
addAdditionalBooks
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder addAdditionalBooks(BookWrapper element) Adds one element toadditionalBookslist.- Parameters:
element- A additionalBooks element- Returns:
thisbuilder for use in a chained invocation
-
addAdditionalBooks
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder addAdditionalBooks(BookWrapper... elements) Adds elements toadditionalBookslist.- Parameters:
elements- An array of additionalBooks elements- Returns:
thisbuilder for use in a chained invocation
-
additionalBooks
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder additionalBooks(Iterable<? extends BookWrapper> elements) Sets or replaces all elements foradditionalBookslist.- Parameters:
elements- An iterable of additionalBooks elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAdditionalBooks
@CanIgnoreReturnValue public final ImmutableOfferObject.Builder addAllAdditionalBooks(Iterable<? extends BookWrapper> elements) Adds elements toadditionalBookslist.- Parameters:
elements- An iterable of additionalBooks elements- Returns:
thisbuilder for use in a chained invocation
-
index
Initializes the value for theindexattribute.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableOfferObject.- Returns:
- An immutable instance of OfferObject
- Throws:
IllegalStateException- if any required attributes are missing
-