Class ImmutableMemo

java.lang.Object
org.xrpl.xrpl4j.model.transactions.Memo
org.xrpl.xrpl4j.model.transactions.ImmutableMemo

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMemo extends Memo
Immutable implementation of Memo.

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

  • Method Details

    • memoData

      public Optional<String> memoData()
      Arbitrary hex value, conventionally containing the content of the memo.
      Specified by:
      memoData in class Memo
      Returns:
      An Optional of type String containing the memo data.
    • memoFormat

      public Optional<String> memoFormat()
      Hex value representing characters allowed in URLs. Conventionally containing information on how the memo is encoded.
      Specified by:
      memoFormat in class Memo
      Returns:
      An Optional of type String containing the memo format.
    • memoType

      public Optional<String> memoType()
      Hex value representing characters allowed in URLs. Conventionally, a unique relation that defines the format of this memo.
      Specified by:
      memoType in class Memo
      Returns:
      An Optional of type String containing the memo type.
    • withMemoData

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

      public final ImmutableMemo withMemoData(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the memoData 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 memoData
      Returns:
      A modified copy of this object
    • withMemoFormat

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

      public final ImmutableMemo withMemoFormat(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the memoFormat 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 memoFormat
      Returns:
      A modified copy of this object
    • withMemoType

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

      public final ImmutableMemo withMemoType(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the memoType 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 memoType
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableMemo 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: memoData, memoFormat, memoType.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableMemo.Builder builder()
      Creates a builder for ImmutableMemo.
       ImmutableMemo.builder()
          .memoData(String) // optional memoData
          .memoFormat(String) // optional memoFormat
          .memoType(String) // optional memoType
          .build();
       
      Returns:
      A new ImmutableMemo builder