Class ImmutableCredentialObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableCredentialObject
All Implemented Interfaces:
CredentialObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      Indicates that this object is a CredentialObject object.
      Specified by:
      ledgerEntryType in interface CredentialObject
      Returns:
      Always LedgerObject.LedgerEntryType.CREDENTIAL.
    • subject

      public Address subject()
      The account that this credential is for.
      Specified by:
      subject in interface CredentialObject
      Returns:
      The Address of the credential recipient.
    • subjectNode

      public String subjectNode()
      A hint indicating which page of the subject's owner directory links to this entry, in case the directory consists of multiple pages.
      Specified by:
      subjectNode in interface CredentialObject
      Returns:
      A String containing the subject node hint.
    • issuer

      public Address issuer()
      The account that issued this credential.
      Specified by:
      issuer in interface CredentialObject
      Returns:
      The Address of the credential issuer.
    • issuerNode

      public String issuerNode()
      A hint indicating which page of the issuer's directory links to this entry, in case the directory consists of multiple pages.
      Specified by:
      issuerNode in interface CredentialObject
      Returns:
      A String containing the issuer node hint.
    • flags

      public CredentialFlags flags()
      A set of boolean CredentialFlags containing options enabled for this object.
      Specified by:
      flags in interface CredentialObject
      Returns:
      The CredentialFlags for this object.
    • previousTxnId

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

      public CredentialType credentialType()
      A (hex-encoded) value to identify the type of credential from the issuer. This field is limited to a maximum length of 64 bytes.
      Specified by:
      credentialType in interface CredentialObject
      Returns:
      A CredentialType defining the type of credential.
    • uri

      public Optional<CredentialUri> uri()
      Optional additional data about the credential (such as a link to the VC document). This field isn't checked for validity and is limited to a maximum length of 256 bytes.
      Specified by:
      uri in interface CredentialObject
      Returns:
      An Optional of type CredentialUri.
    • expiration

      public Optional<com.google.common.primitives.UnsignedInteger> expiration()
      Time after which the credential is expired, in seconds since the Ripple Epoch.
      Specified by:
      expiration in interface CredentialObject
      Returns:
      An Optional of type UnsignedInteger.
    • index

      public Hash256 index()
      The unique ID of the CredentialObject.
      Specified by:
      index in interface CredentialObject
      Returns:
      A Hash256.
    • withSubject

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

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

      public final ImmutableCredentialObject 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
    • withIssuerNode

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

      public final ImmutableCredentialObject withFlags(CredentialFlags 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
    • withPreviousTxnId

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

      public final ImmutableCredentialObject 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
    • withCredentialType

      public final ImmutableCredentialObject 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
    • withUri

      public final ImmutableCredentialObject withUri(CredentialUri value)
      Copy the current immutable object by setting a present value for the optional uri attribute.
      Parameters:
      value - The value for uri
      Returns:
      A modified copy of this object
    • withUri

      public final ImmutableCredentialObject withUri(Optional<? extends CredentialUri> optional)
      Copy the current immutable object by setting an optional value for the uri 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 uri
      Returns:
      A modified copy of this object
    • withExpiration

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

      public final ImmutableCredentialObject withExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the expiration 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 expiration
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableCredentialObject 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 ImmutableCredentialObject 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, subject, subjectNode, issuer, issuerNode, flags, previousTxnId, previousTransactionLedgerSequence, credentialType, uri, expiration, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableCredentialObject.Builder builder()
      Creates a builder for ImmutableCredentialObject.
       ImmutableCredentialObject.builder()
          .subject(org.xrpl.xrpl4j.model.transactions.Address) // required subject
          .subjectNode(String) // required subjectNode
          .issuer(org.xrpl.xrpl4j.model.transactions.Address) // required issuer
          .issuerNode(String) // required issuerNode
          .flags(org.xrpl.xrpl4j.model.flags.CredentialFlags) // required flags
          .previousTxnId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTxnId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .credentialType(org.xrpl.xrpl4j.model.transactions.CredentialType) // required credentialType
          .uri(org.xrpl.xrpl4j.model.transactions.CredentialUri) // optional uri
          .expiration(com.google.common.primitives.UnsignedInteger) // optional expiration
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableCredentialObject builder