Class ImmutableBridgeObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableBridgeObject
All Implemented Interfaces:
BridgeObject, LedgerObject

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableBridgeObject extends Object implements BridgeObject
Immutable implementation of BridgeObject.

Use the builder to create immutable instances: ImmutableBridgeObject.builder().

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object, which will always be "Bridge" in this case.
      Specified by:
      ledgerEntryType in interface BridgeObject
      Returns:
      Always returns LedgerObject.LedgerEntryType.BRIDGE.
    • flags

      public Flags flags()
      A bit-map of boolean flags. No flags are defined for BridgeObject, so this value is always 0.
      Specified by:
      flags in interface BridgeObject
      Returns:
      Always Flags.UNSET.
    • account

      public Address account()
      The account that owns this object.
      Specified by:
      account in interface BridgeObject
      Returns:
      An Address.
    • minAccountCreateAmount

      public Optional<XrpCurrencyAmount> minAccountCreateAmount()
      The minimum amount, in XRP, required for an XChainAccountCreateCommit transaction. If this isn't present, the XChainAccountCreateCommit transaction will fail. This field can only be present on XRP-XRP bridges.
      Specified by:
      minAccountCreateAmount in interface BridgeObject
      Returns:
      An optionally-present XrpCurrencyAmount.
    • signatureReward

      public XrpCurrencyAmount signatureReward()
      The total amount, in XRP, to be rewarded for providing a signature for cross-chain transfer or for signing for the cross-chain reward. This amount will be split among the signers.
      Specified by:
      signatureReward in interface BridgeObject
      Returns:
      An XrpCurrencyAmount.
    • xChainBridge

      public XChainBridge xChainBridge()
      The door accounts and assets of the bridge this object correlates to.
      Specified by:
      xChainBridge in interface BridgeObject
      Returns:
      An XChainBridge.
    • xChainClaimId

      public XChainClaimId xChainClaimId()
      The value of the next XChainClaimID to be created.
      Specified by:
      xChainClaimId in interface BridgeObject
      Returns:
      An XChainClaimId.
    • xChainAccountCreateCount

      public XChainCount xChainAccountCreateCount()
      A counter used to order the execution of account create transactions. It is incremented every time a successful XChainAccountCreateCommit transaction is run for the source chain.
      Specified by:
      xChainAccountCreateCount in interface BridgeObject
      Returns:
      An XChainCount.
    • xChainAccountClaimCount

      public XChainCount xChainAccountClaimCount()
      A counter used to order the execution of account create transactions. It is incremented every time a XChainAccountCreateCommit transaction is "claimed" on the destination chain. When the "claim" transaction is run on the destination chain, the xChainAccountClaimCount() must match the value that the xChainAccountCreateCount() had at the time the xChainAccountClaimCount() was run on the source chain. This orders the claims so that they run in the same order that the XChainAccountCreateCommit transactions ran on the source chain, to prevent transaction replay.
      Specified by:
      xChainAccountClaimCount in interface BridgeObject
      Returns:
      An XChainCount.
    • ownerNode

      public String 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:
      ownerNode in interface BridgeObject
      Returns:
      A String containing the owner node hint.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface BridgeObject
      Returns:
      A Hash256 containing 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:
      previousTransactionLedgerSequence in interface BridgeObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • index

      public Hash256 index()
      The unique ID of the BridgeObject.
      Specified by:
      index in interface BridgeObject
      Returns:
      A Hash256 containing the ID.
    • withAccount

      public final ImmutableBridgeObject withAccount(Address value)
      Copy the current immutable object by setting a value for the account attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for account
      Returns:
      A modified copy of the this object
    • withMinAccountCreateAmount

      public final ImmutableBridgeObject withMinAccountCreateAmount(XrpCurrencyAmount value)
      Copy the current immutable object by setting a present value for the optional minAccountCreateAmount attribute.
      Parameters:
      value - The value for minAccountCreateAmount
      Returns:
      A modified copy of this object
    • withMinAccountCreateAmount

      public final ImmutableBridgeObject withMinAccountCreateAmount(Optional<? extends XrpCurrencyAmount> optional)
      Copy the current immutable object by setting an optional value for the minAccountCreateAmount attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for minAccountCreateAmount
      Returns:
      A modified copy of this object
    • withSignatureReward

      public final ImmutableBridgeObject withSignatureReward(XrpCurrencyAmount value)
      Copy the current immutable object by setting a value for the signatureReward attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for signatureReward
      Returns:
      A modified copy of the this object
    • withXChainBridge

      public final ImmutableBridgeObject withXChainBridge(XChainBridge value)
      Copy the current immutable object by setting a value for the xChainBridge attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for xChainBridge
      Returns:
      A modified copy of the this object
    • withXChainClaimId

      public final ImmutableBridgeObject withXChainClaimId(XChainClaimId value)
      Copy the current immutable object by setting a value for the xChainClaimId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for xChainClaimId
      Returns:
      A modified copy of the this object
    • withXChainAccountCreateCount

      public final ImmutableBridgeObject withXChainAccountCreateCount(XChainCount value)
      Copy the current immutable object by setting a value for the xChainAccountCreateCount attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for xChainAccountCreateCount
      Returns:
      A modified copy of the this object
    • withXChainAccountClaimCount

      public final ImmutableBridgeObject withXChainAccountClaimCount(XChainCount value)
      Copy the current immutable object by setting a value for the xChainAccountClaimCount attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for xChainAccountClaimCount
      Returns:
      A modified copy of the this object
    • withOwnerNode

      public final ImmutableBridgeObject withOwnerNode(String value)
      Copy the current immutable object by setting a value for the ownerNode attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ownerNode
      Returns:
      A modified copy of the this object
    • withPreviousTransactionId

      public final ImmutableBridgeObject withPreviousTransactionId(Hash256 value)
      Copy the current immutable object by setting a value for the previousTransactionId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionId
      Returns:
      A modified copy of the this object
    • withPreviousTransactionLedgerSequence

      public final ImmutableBridgeObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the previousTransactionLedgerSequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionLedgerSequence
      Returns:
      A modified copy of the this object
    • withIndex

      public final ImmutableBridgeObject withIndex(Hash256 value)
      Copy the current immutable object by setting a value for the index attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for index
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableBridgeObject that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: ledgerEntryType, flags, account, minAccountCreateAmount, signatureReward, xChainBridge, xChainClaimId, xChainAccountCreateCount, xChainAccountClaimCount, ownerNode, previousTransactionId, previousTransactionLedgerSequence, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value BridgeObject with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableBridgeObject copyOf(BridgeObject instance)
      Creates an immutable copy of a BridgeObject value. 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 BridgeObject instance
    • builder

      public static ImmutableBridgeObject.Builder builder()
      Creates a builder for ImmutableBridgeObject.
       ImmutableBridgeObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .minAccountCreateAmount(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // optional minAccountCreateAmount
          .signatureReward(org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount) // required signatureReward
          .xChainBridge(org.xrpl.xrpl4j.model.transactions.XChainBridge) // required xChainBridge
          .xChainClaimId(org.xrpl.xrpl4j.model.transactions.XChainClaimId) // required xChainClaimId
          .xChainAccountCreateCount(org.xrpl.xrpl4j.model.transactions.XChainCount) // required xChainAccountCreateCount
          .xChainAccountClaimCount(org.xrpl.xrpl4j.model.transactions.XChainCount) // required xChainAccountClaimCount
          .ownerNode(String) // required ownerNode
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableBridgeObject builder