Class ImmutableSignature

java.lang.Object
org.xrpl.xrpl4j.crypto.core.signing.ImmutableSignature
All Implemented Interfaces:
Signature

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

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

  • Method Details

    • value

      public UnsignedByteArray value()
      The bytes of this signature.
      Specified by:
      value in interface Signature
      Returns:
      A UnsignedByteArray.
    • withValue

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

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

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

      public String base16Value()
      Accessor for this signature as a base16-encoded (HEX) string.

      Returns a lazily initialized value of the base16Value attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Specified by:
      base16Value in interface Signature
      Returns:
      A lazily initialized value of the base16Value attribute
    • hexValue

      public String hexValue()
      Accessor for this signature as a base16-encoded (HEX) string.

      Returns a lazily initialized value of the hexValue attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Specified by:
      hexValue in interface Signature
      Returns:
      A lazily initialized value of the hexValue attribute
    • copyOf

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

      public static ImmutableSignature.Builder builder()
      Creates a builder for ImmutableSignature.
       ImmutableSignature.builder()
          .value(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required value
          .build();
       
      Returns:
      A new ImmutableSignature builder