Package org.xrpl.xrpl4j.model.ledger
Class ImmutablePayChannelObject.Builder
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutablePayChannelObject.Builder
- Enclosing class:
ImmutablePayChannelObject
Builds instances of type
ImmutablePayChannelObject.
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.amount(XrpCurrencyAmount amount) Initializes the value for theamountattribute.balance(XrpCurrencyAmount balance) Initializes the value for thebalanceattribute.build()Builds a newImmutablePayChannelObject.cancelAfter(com.google.common.primitives.UnsignedLong cancelAfter) Initializes the optional valuecancelAfterto cancelAfter.cancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> cancelAfter) Initializes the optional valuecancelAfterto cancelAfter.destination(Address destination) Initializes the value for thedestinationattribute.destinationTag(com.google.common.primitives.UnsignedInteger destinationTag) Initializes the optional valuedestinationTagto destinationTag.destinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> destinationTag) Initializes the optional valuedestinationTagto destinationTag.expiration(com.google.common.primitives.UnsignedLong expiration) Initializes the optional valueexpirationto expiration.expiration(Optional<? extends com.google.common.primitives.UnsignedLong> expiration) Initializes the optional valueexpirationto expiration.from(PayChannelObject instance) Fill a builder with attribute values from the providedPayChannelObjectinstance.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.Initializes the value for thepublicKeyattribute.settleDelay(com.google.common.primitives.UnsignedLong settleDelay) Initializes the value for thesettleDelayattribute.sourceTag(com.google.common.primitives.UnsignedInteger sourceTag) Initializes the optional valuesourceTagto sourceTag.Initializes the optional valuesourceTagto sourceTag.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder from(PayChannelObject instance) Fill a builder with attribute values from the providedPayChannelObjectinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- 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
-
destination
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder destination(Address destination) Initializes the value for thedestinationattribute.- Parameters:
destination- The value for destination- Returns:
thisbuilder for use in a chained invocation
-
amount
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder amount(XrpCurrencyAmount amount) Initializes the value for theamountattribute.- Parameters:
amount- The value for amount- Returns:
thisbuilder for use in a chained invocation
-
balance
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder balance(XrpCurrencyAmount balance) Initializes the value for thebalanceattribute.- Parameters:
balance- The value for balance- Returns:
thisbuilder for use in a chained invocation
-
publicKey
Initializes the value for thepublicKeyattribute.- Parameters:
publicKey- The value for publicKey- Returns:
thisbuilder for use in a chained invocation
-
settleDelay
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder settleDelay(com.google.common.primitives.UnsignedLong settleDelay) Initializes the value for thesettleDelayattribute.- Parameters:
settleDelay- The value for settleDelay- 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 ImmutablePayChannelObject.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 ImmutablePayChannelObject.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 ImmutablePayChannelObject.Builder expiration(com.google.common.primitives.UnsignedLong expiration) Initializes the optional valueexpirationto expiration.- Parameters:
expiration- The value for expiration- Returns:
thisbuilder for chained invocation
-
expiration
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder expiration(Optional<? extends com.google.common.primitives.UnsignedLong> expiration) Initializes the optional valueexpirationto expiration.- Parameters:
expiration- The value for expiration- Returns:
thisbuilder for use in a chained invocation
-
cancelAfter
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder cancelAfter(com.google.common.primitives.UnsignedLong cancelAfter) Initializes the optional valuecancelAfterto cancelAfter.- Parameters:
cancelAfter- The value for cancelAfter- Returns:
thisbuilder for chained invocation
-
cancelAfter
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder cancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> cancelAfter) Initializes the optional valuecancelAfterto cancelAfter.- Parameters:
cancelAfter- The value for cancelAfter- Returns:
thisbuilder for use in a chained invocation
-
sourceTag
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder sourceTag(com.google.common.primitives.UnsignedInteger sourceTag) Initializes the optional valuesourceTagto sourceTag.- Parameters:
sourceTag- The value for sourceTag- Returns:
thisbuilder for chained invocation
-
sourceTag
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder sourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> sourceTag) Initializes the optional valuesourceTagto sourceTag.- Parameters:
sourceTag- The value for sourceTag- Returns:
thisbuilder for use in a chained invocation
-
destinationTag
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder destinationTag(com.google.common.primitives.UnsignedInteger destinationTag) Initializes the optional valuedestinationTagto destinationTag.- Parameters:
destinationTag- The value for destinationTag- Returns:
thisbuilder for chained invocation
-
destinationTag
@CanIgnoreReturnValue public final ImmutablePayChannelObject.Builder destinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> destinationTag) Initializes the optional valuedestinationTagto destinationTag.- Parameters:
destinationTag- The value for destinationTag- 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 newImmutablePayChannelObject.- Returns:
- An immutable instance of PayChannelObject
- Throws:
IllegalStateException- if any required attributes are missing
-