Package org.xrpl.xrpl4j.model.ledger
Class ImmutablePayChannelObject
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutablePayChannelObject
- All Implemented Interfaces:
LedgerObject,PayChannelObject
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutablePayChannelObject
extends Object
implements PayChannelObject
Immutable implementation of
PayChannelObject.
Use the builder to create immutable instances:
ImmutablePayChannelObject.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutablePayChannelObject.Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionaccount()The sourceAddressthat owns this payment channel.amount()Total XRP, in drops, that has been allocated to this channel.balance()Total XRP, in drops, already paid out by the channel.builder()Creates a builder forImmutablePayChannelObject.Optional<com.google.common.primitives.UnsignedLong> The immutable expiration time for this payment channel, in seconds since the Ripple Epoch.static ImmutablePayChannelObjectcopyOf(PayChannelObject instance) Creates an immutable copy of aPayChannelObjectvalue.The destinationAddressfor this payment channel.Optional<com.google.common.primitives.UnsignedInteger> An arbitrary tag to further specify thedestination()for this payment channel, such as a hosted recipient at the destination address.booleanThis instance is equal to all instances ofImmutablePayChannelObjectthat have equal attribute values.Optional<com.google.common.primitives.UnsignedLong> The mutable expiration time for this payment channel, in seconds since the Ripple Epoch.flags()A bit-map of boolean flags enabled for this payment channel.inthashCode()Computes a hash code from attributes:ledgerEntryType,flags,account,destination,amount,balance,publicKey,settleDelay,ownerNode,previousTransactionId,previousTransactionLedgerSequence,expiration,cancelAfter,sourceTag,destinationTag,index.index()Unique ID for this channel.The type of ledger object, which is always "PayChannel".A hint indicating which page of the source address'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.Public key, in hexadecimal, of the key pair that can be used to sign claims against this channel.com.google.common.primitives.UnsignedLongNumber of seconds the source address must wait to close the channel if it still has any XRP in it.Optional<com.google.common.primitives.UnsignedInteger> An arbitrary tag to further specify theaccount()for this payment channel, such as a hosted recipient at the owner's address.toString()Prints the immutable valuePayChannelObjectwith attribute values.withAccount(Address value) Copy the current immutable object by setting a value for theaccountattribute.withAmount(XrpCurrencyAmount value) Copy the current immutable object by setting a value for theamountattribute.withBalance(XrpCurrencyAmount value) Copy the current immutable object by setting a value for thebalanceattribute.withCancelAfter(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a present value for the optionalcancelAfterattribute.withCancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for thecancelAfterattribute.withDestination(Address value) Copy the current immutable object by setting a value for thedestinationattribute.withDestinationTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionaldestinationTagattribute.withDestinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thedestinationTagattribute.withExpiration(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a present value for the optionalexpirationattribute.withExpiration(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for theexpirationattribute.Copy the current immutable object by setting a value for theindexattribute.withOwnerNode(String value) Copy the current immutable object by setting a value for theownerNodeattribute.withPreviousTransactionId(Hash256 value) Copy the current immutable object by setting a value for thepreviousTransactionIdattribute.withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute.withPublicKey(String value) Copy the current immutable object by setting a value for thepublicKeyattribute.withSettleDelay(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a value for thesettleDelayattribute.withSourceTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalsourceTagattribute.withSourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thesourceTagattribute.
-
Method Details
-
ledgerEntryType
The type of ledger object, which is always "PayChannel".- Specified by:
ledgerEntryTypein interfacePayChannelObject- Returns:
- Always
LedgerObject.LedgerEntryType.PAY_CHANNEL.
-
flags
A bit-map of boolean flags enabled for this payment channel. Currently, the protocol defines no flags for PayChannel objects.- Specified by:
flagsin interfacePayChannelObject- Returns:
- Always
Flags.UNSET.
-
account
The sourceAddressthat owns this payment channel. This comes from the sendingAddressof thePaymentChannelCreatetransaction that created the channel.- Specified by:
accountin interfacePayChannelObject- Returns:
- The
Addressof the source account.
-
destination
The destinationAddressfor this payment channel. While the payment channel is open, thisAddressis the only one that can receive XRP from the channel. This comes from thePaymentChannelCreate.destination()field of the transaction that created the channel.- Specified by:
destinationin interfacePayChannelObject- Returns:
- The
Addressof the destination account.
-
amount
Total XRP, in drops, that has been allocated to this channel. This includes XRP that has been paid to thedestination()address. This is initially set by thePaymentChannelCreatetransaction that created the channel and can be increased if the source address sends aPaymentChannelFundtransaction.- Specified by:
amountin interfacePayChannelObject- Returns:
- An
XrpCurrencyAmountrepresenting the total amount allocated to this channel.
-
balance
Total XRP, in drops, already paid out by the channel. The difference between this value and theamount()field is how much XRP can still be paid to thedestination()address withPaymentChannelClaimtransactions. If the channel closes, the remaining difference is returned to theaccount()address.- Specified by:
balancein interfacePayChannelObject- Returns:
- An
XrpCurrencyAmountrepresenting the total amount paid out by this channel.
-
publicKey
Public key, in hexadecimal, of the key pair that can be used to sign claims against this channel. This can be any valid secp256k1 or Ed25519 public key. This is set by thePaymentChannelCreatetransaction that created the channel and must match the public key used in claims against the channel. The channelaccount()can also send XRP from this channel to thedestination()without signed claims.- Specified by:
publicKeyin interfacePayChannelObject- Returns:
- A
Stringcontaining the payment channel's public key.
-
settleDelay
public com.google.common.primitives.UnsignedLong settleDelay()Number of seconds the source address must wait to close the channel if it still has any XRP in it. Smaller values mean that thedestination()has less time to redeem any outstanding claims after the source address requests to close the channel.- Specified by:
settleDelayin interfacePayChannelObject- Returns:
- An
UnsignedLongrepresenting the settlement delay.
-
ownerNode
A hint indicating which page of the source address's owner directory links to this object, in case the directory consists of multiple pages.- Specified by:
ownerNodein interfacePayChannelObject- Returns:
- A
Stringcontaining the hint.
-
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTransactionIdin interfacePayChannelObject- 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 interfacePayChannelObject- Returns:
- An
UnsignedIntegerrepresenting the previous transaction ledger sequence.
-
expiration
The mutable expiration time for this payment channel, in seconds since the Ripple Epoch. The channel is expired if this value is present and smaller than the previousLedgerHeader.closeTime()field.- Specified by:
expirationin interfacePayChannelObject- Returns:
- An
Optionalof typeUnsignedLongrepresenting the expiration time.
-
cancelAfter
The immutable expiration time for this payment channel, in seconds since the Ripple Epoch. This channel is expired if this value is present and smaller than the previousLedgerHeader.closeTime()field.- Specified by:
cancelAfterin interfacePayChannelObject- Returns:
- An
Optionalof typeUnsignedLongrepresenting the cancel after time.
-
sourceTag
An arbitrary tag to further specify theaccount()for this payment channel, such as a hosted recipient at the owner's address.- Specified by:
sourceTagin interfacePayChannelObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the tag of the source account.
-
destinationTag
An arbitrary tag to further specify thedestination()for this payment channel, such as a hosted recipient at the destination address.- Specified by:
destinationTagin interfacePayChannelObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the tag of the destination account.
-
index
Unique ID for this channel.- Specified by:
indexin interfacePayChannelObject- 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
-
withDestination
Copy the current immutable object by setting a value for thedestinationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for destination- Returns:
- A modified copy of the
thisobject
-
withAmount
Copy the current immutable object by setting a value for theamountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for amount- Returns:
- A modified copy of the
thisobject
-
withBalance
Copy the current immutable object by setting a value for thebalanceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for balance- Returns:
- A modified copy of the
thisobject
-
withPublicKey
Copy the current immutable object by setting a value for thepublicKeyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for publicKey- Returns:
- A modified copy of the
thisobject
-
withSettleDelay
public final ImmutablePayChannelObject withSettleDelay(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a value for thesettleDelayattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for settleDelay- 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 ImmutablePayChannelObject 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 ImmutablePayChannelObject withExpiration(com.google.common.primitives.UnsignedLong 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 ImmutablePayChannelObject withExpiration(Optional<? extends com.google.common.primitives.UnsignedLong> 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
-
withCancelAfter
public final ImmutablePayChannelObject withCancelAfter(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a present value for the optionalcancelAfterattribute.- Parameters:
value- The value for cancelAfter- Returns:
- A modified copy of
thisobject
-
withCancelAfter
public final ImmutablePayChannelObject withCancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for thecancelAfterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for cancelAfter- Returns:
- A modified copy of
thisobject
-
withSourceTag
public final ImmutablePayChannelObject withSourceTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalsourceTagattribute.- Parameters:
value- The value for sourceTag- Returns:
- A modified copy of
thisobject
-
withSourceTag
public final ImmutablePayChannelObject withSourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thesourceTagattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for sourceTag- Returns:
- A modified copy of
thisobject
-
withDestinationTag
public final ImmutablePayChannelObject withDestinationTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionaldestinationTagattribute.- Parameters:
value- The value for destinationTag- Returns:
- A modified copy of
thisobject
-
withDestinationTag
public final ImmutablePayChannelObject withDestinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thedestinationTagattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for destinationTag- 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 ofImmutablePayChannelObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,flags,account,destination,amount,balance,publicKey,settleDelay,ownerNode,previousTransactionId,previousTransactionLedgerSequence,expiration,cancelAfter,sourceTag,destinationTag,index. -
toString
Prints the immutable valuePayChannelObjectwith attribute values. -
copyOf
Creates an immutable copy of aPayChannelObjectvalue. 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 PayChannelObject instance
-
builder
Creates a builder forImmutablePayChannelObject.ImmutablePayChannelObject.builder() .account(org.xrpl.xrpl4j.model.transactions.Address) // requiredaccount.destination(org.xrpl.xrpl4j.model.transactions.Address) // requireddestination.amount(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // requiredamount.balance(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // requiredbalance.publicKey(String) // requiredpublicKey.settleDelay(com.google.common.primitives.UnsignedLong) // requiredsettleDelay.ownerNode(String) // requiredownerNode.previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredpreviousTransactionId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // requiredpreviousTransactionLedgerSequence.expiration(com.google.common.primitives.UnsignedLong) // optionalexpiration.cancelAfter(com.google.common.primitives.UnsignedLong) // optionalcancelAfter.sourceTag(com.google.common.primitives.UnsignedInteger) // optionalsourceTag.destinationTag(com.google.common.primitives.UnsignedInteger) // optionaldestinationTag.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutablePayChannelObject builder
-