Class ImmutableCredential

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableCredential
All Implemented Interfaces:
Credential

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

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

  • Method Details

    • issuer

      public Address issuer()
      The issuer of the credential.
      Specified by:
      issuer in interface Credential
      Returns:
      The Address of the issuer this credential.
    • credentialType

      public CredentialType credentialType()
      A (hex-encoded) value to identify the type of credential from the issuer.
      Specified by:
      credentialType in interface Credential
      Returns:
      The CredentialType denoting the CredentialType
    • withIssuer

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

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

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

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

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

      public static ImmutableCredential.Builder builder()
      Creates a builder for ImmutableCredential.
       ImmutableCredential.builder()
          .issuer(org.xrpl.xrpl4j.model.transactions.Address) // required issuer
          .credentialType(org.xrpl.xrpl4j.model.transactions.CredentialType) // required credentialType
          .build();
       
      Returns:
      A new ImmutableCredential builder