Class ImmutableRippleStateObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableRippleStateObject
All Implemented Interfaces:
LedgerObject, RippleStateObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object. In this case, this is always "RippleState".
      Specified by:
      ledgerEntryType in interface RippleStateObject
      Returns:
      Always LedgerObject.LedgerEntryType.RIPPLE_STATE.
    • flags

      public RippleStateFlags flags()
      A set of boolean RippleStateFlags containing options enabled for this object.
      Specified by:
      flags in interface RippleStateObject
      Returns:
      The RippleStateFlags for this object.
    • balance

      public IssuedCurrencyAmount balance()
      The balance of the trust line, from the perspective of the low account. A negative balance indicates that the low account has issued currency to the high account. The issuer in this is always set to the neutral value ACCOUNT_ONE.
      Specified by:
      balance in interface RippleStateObject
      Returns:
      An IssuedCurrencyAmount containing the balance of this trust line.
    • lowLimit

      public IssuedCurrencyAmount lowLimit()
      The limit that the low account has set on the trust line. The issuer is the address of the low account that set this limit.
      Specified by:
      lowLimit in interface RippleStateObject
      Returns:
      An IssuedCurrencyAmount containing the low account's limit on this trust line.
    • highLimit

      public IssuedCurrencyAmount highLimit()
      The limit that the high account has set on the trust line. The issuer is the address of the high account that set this limit.
      Specified by:
      highLimit in interface RippleStateObject
      Returns:
      An IssuedCurrencyAmount containing the high account's limit on this trust line.
    • previousTransactionId

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

      public Optional<String> lowNode()
      (Omitted in some historical ledgers) A hint indicating which page of the low account's owner directory links to this object, in case the directory consists of multiple pages.
      Specified by:
      lowNode in interface RippleStateObject
      Returns:
      An Optional of type String containing the hint.
    • highNode

      public Optional<String> highNode()
      (Omitted in some historical ledgers) A hint indicating which page of the high account's owner directory links to this object, in case the directory consists of multiple pages.
      Specified by:
      highNode in interface RippleStateObject
      Returns:
      An Optional of type String containing the hint.
    • lowQualityIn

      public Optional<com.google.common.primitives.UnsignedInteger> lowQualityIn()
      The inbound quality set by the low account, as an integer in the implied ratio LowQualityOut:1,000,000,000. As a special case, the value 0 is equivalent to 1 billion, or face value.
      Specified by:
      lowQualityIn in interface RippleStateObject
      Returns:
      An Optional of type UnsignedInteger representing the low account's inbound quality.
    • lowQualityOut

      public Optional<com.google.common.primitives.UnsignedInteger> lowQualityOut()
      The outbound quality set by the low account, as an integer in the implied ratio LowQualityOut:1,000,000,000. As a special case, the value 0 is equivalent to 1 billion, or face value.
      Specified by:
      lowQualityOut in interface RippleStateObject
      Returns:
      An Optional of type UnsignedInteger representing the low account's outbound quality.
    • highQualityIn

      public Optional<com.google.common.primitives.UnsignedInteger> highQualityIn()
      The inbound quality set by the high account, as an integer in the implied ratio LowQualityOut:1,000,000,000. As a special case, the value 0 is equivalent to 1 billion, or face value.
      Specified by:
      highQualityIn in interface RippleStateObject
      Returns:
      An Optional of type UnsignedInteger representing the high account's inbound quality.
    • highQualityOut

      public Optional<com.google.common.primitives.UnsignedInteger> highQualityOut()
      The outbound quality set by the high account, as an integer in the implied ratio LowQualityOut:1,000,000,000. As a special case, the value 0 is equivalent to 1 billion, or face value.
      Specified by:
      highQualityOut in interface RippleStateObject
      Returns:
      An Optional of type UnsignedInteger representing the high account's outbound quality.
    • index

      public Hash256 index()
      Unique identifier for this RippleStateObject.
      Specified by:
      index in interface RippleStateObject
      Returns:
      A Hash256 containing the ID.
    • withFlags

      public final ImmutableRippleStateObject withFlags(RippleStateFlags value)
      Copy the current immutable object by setting a value for the flags attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for flags
      Returns:
      A modified copy of the this object
    • withBalance

      public final ImmutableRippleStateObject withBalance(IssuedCurrencyAmount value)
      Copy the current immutable object by setting a value for the balance attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for balance
      Returns:
      A modified copy of the this object
    • withLowLimit

      public final ImmutableRippleStateObject withLowLimit(IssuedCurrencyAmount value)
      Copy the current immutable object by setting a value for the lowLimit attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for lowLimit
      Returns:
      A modified copy of the this object
    • withHighLimit

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

      public final ImmutableRippleStateObject 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 ImmutableRippleStateObject 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
    • withLowNode

      public final ImmutableRippleStateObject withLowNode(String value)
      Copy the current immutable object by setting a present value for the optional lowNode attribute.
      Parameters:
      value - The value for lowNode
      Returns:
      A modified copy of this object
    • withLowNode

      public final ImmutableRippleStateObject withLowNode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the lowNode attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for lowNode
      Returns:
      A modified copy of this object
    • withHighNode

      public final ImmutableRippleStateObject withHighNode(String value)
      Copy the current immutable object by setting a present value for the optional highNode attribute.
      Parameters:
      value - The value for highNode
      Returns:
      A modified copy of this object
    • withHighNode

      public final ImmutableRippleStateObject withHighNode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the highNode attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for highNode
      Returns:
      A modified copy of this object
    • withLowQualityIn

      public final ImmutableRippleStateObject withLowQualityIn(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional lowQualityIn attribute.
      Parameters:
      value - The value for lowQualityIn
      Returns:
      A modified copy of this object
    • withLowQualityIn

      public final ImmutableRippleStateObject withLowQualityIn(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the lowQualityIn attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for lowQualityIn
      Returns:
      A modified copy of this object
    • withLowQualityOut

      public final ImmutableRippleStateObject withLowQualityOut(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional lowQualityOut attribute.
      Parameters:
      value - The value for lowQualityOut
      Returns:
      A modified copy of this object
    • withLowQualityOut

      public final ImmutableRippleStateObject withLowQualityOut(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the lowQualityOut attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for lowQualityOut
      Returns:
      A modified copy of this object
    • withHighQualityIn

      public final ImmutableRippleStateObject withHighQualityIn(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional highQualityIn attribute.
      Parameters:
      value - The value for highQualityIn
      Returns:
      A modified copy of this object
    • withHighQualityIn

      public final ImmutableRippleStateObject withHighQualityIn(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the highQualityIn attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for highQualityIn
      Returns:
      A modified copy of this object
    • withHighQualityOut

      public final ImmutableRippleStateObject withHighQualityOut(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional highQualityOut attribute.
      Parameters:
      value - The value for highQualityOut
      Returns:
      A modified copy of this object
    • withHighQualityOut

      public final ImmutableRippleStateObject withHighQualityOut(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the highQualityOut attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for highQualityOut
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableRippleStateObject 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 ImmutableRippleStateObject 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, balance, lowLimit, highLimit, previousTransactionId, previousTransactionLedgerSequence, lowNode, highNode, lowQualityIn, lowQualityOut, highQualityIn, highQualityOut, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableRippleStateObject copyOf(RippleStateObject instance)
      Creates an immutable copy of a RippleStateObject 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 RippleStateObject instance
    • builder

      public static ImmutableRippleStateObject.Builder builder()
      Creates a builder for ImmutableRippleStateObject.
       ImmutableRippleStateObject.builder()
          .flags(org.xrpl.xrpl4j.model.flags.RippleStateFlags) // required flags
          .balance(org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount) // required balance
          .lowLimit(org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount) // required lowLimit
          .highLimit(org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount) // required highLimit
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .lowNode(String) // optional lowNode
          .highNode(String) // optional highNode
          .lowQualityIn(com.google.common.primitives.UnsignedInteger) // optional lowQualityIn
          .lowQualityOut(com.google.common.primitives.UnsignedInteger) // optional lowQualityOut
          .highQualityIn(com.google.common.primitives.UnsignedInteger) // optional highQualityIn
          .highQualityOut(com.google.common.primitives.UnsignedInteger) // optional highQualityOut
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableRippleStateObject builder