Package org.xrpl.xrpl4j.model.ledger
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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableCredentialObject.Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableCredentialObject.static ImmutableCredentialObjectcopyOf(CredentialObject instance) Creates an immutable copy of aCredentialObjectvalue.A (hex-encoded) value to identify the type of credential from the issuer.booleanThis instance is equal to all instances ofImmutableCredentialObjectthat have equal attribute values.Optional<com.google.common.primitives.UnsignedInteger> Time after which the credential is expired, in seconds since the Ripple Epoch.flags()A set of booleanCredentialFlagscontaining options enabled for this object.inthashCode()Computes a hash code from attributes:ledgerEntryType,subject,subjectNode,issuer,issuerNode,flags,previousTxnId,previousTransactionLedgerSequence,credentialType,uri,expiration,index.index()The unique ID of theCredentialObject.issuer()The account that issued this credential.A hint indicating which page of the issuer's directory links to this entry, in case the directory consists of multiple pages.Indicates that this object is aCredentialObjectobject.com.google.common.primitives.UnsignedIntegerThe index of the ledger that contains the transaction that most recently modified this object.The identifying hash of the transaction that most recently modified this object.subject()The account that this credential is for.A hint indicating which page of the subject's owner directory links to this entry, in case the directory consists of multiple pages.toString()Prints the immutable valueCredentialObjectwith attribute values.uri()Optional additional data about the credential (such as a link to the VC document).withCredentialType(CredentialType value) Copy the current immutable object by setting a value for thecredentialTypeattribute.withExpiration(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalexpirationattribute.withExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for theexpirationattribute.withFlags(CredentialFlags value) Copy the current immutable object by setting a value for theflagsattribute.Copy the current immutable object by setting a value for theindexattribute.withIssuer(Address value) Copy the current immutable object by setting a value for theissuerattribute.withIssuerNode(String value) Copy the current immutable object by setting a value for theissuerNodeattribute.withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute.withPreviousTxnId(Hash256 value) Copy the current immutable object by setting a value for thepreviousTxnIdattribute.withSubject(Address value) Copy the current immutable object by setting a value for thesubjectattribute.withSubjectNode(String value) Copy the current immutable object by setting a value for thesubjectNodeattribute.withUri(Optional<? extends CredentialUri> optional) Copy the current immutable object by setting an optional value for theuriattribute.withUri(CredentialUri value) Copy the current immutable object by setting a present value for the optionaluriattribute.
-
Method Details
-
ledgerEntryType
Indicates that this object is aCredentialObjectobject.- Specified by:
ledgerEntryTypein interfaceCredentialObject- Returns:
- Always
LedgerObject.LedgerEntryType.CREDENTIAL.
-
subject
The account that this credential is for.- Specified by:
subjectin interfaceCredentialObject- Returns:
- The
Addressof the credential recipient.
-
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:
subjectNodein interfaceCredentialObject- Returns:
- A
Stringcontaining the subject node hint.
-
issuer
The account that issued this credential.- Specified by:
issuerin interfaceCredentialObject- Returns:
- The
Addressof the credential issuer.
-
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:
issuerNodein interfaceCredentialObject- Returns:
- A
Stringcontaining the issuer node hint.
-
flags
A set of booleanCredentialFlagscontaining options enabled for this object.- Specified by:
flagsin interfaceCredentialObject- Returns:
- The
CredentialFlagsfor this object.
-
previousTxnId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTxnIdin interfaceCredentialObject- Returns:
- A
Hash256containing 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:
previousTransactionLedgerSequencein interfaceCredentialObject- Returns:
- A
UnsignedIntegerrepresenting the previous transaction sequence.
-
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:
credentialTypein interfaceCredentialObject- Returns:
- A
CredentialTypedefining the type of credential.
-
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:
uriin interfaceCredentialObject- Returns:
- An
Optionalof typeCredentialUri.
-
expiration
Time after which the credential is expired, in seconds since the Ripple Epoch.- Specified by:
expirationin interfaceCredentialObject- Returns:
- An
Optionalof typeUnsignedInteger.
-
index
The unique ID of theCredentialObject.- Specified by:
indexin interfaceCredentialObject- Returns:
- A
Hash256.
-
withSubject
Copy the current immutable object by setting a value for thesubjectattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for subject- Returns:
- A modified copy of the
thisobject
-
withSubjectNode
Copy the current immutable object by setting a value for thesubjectNodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for subjectNode- Returns:
- A modified copy of the
thisobject
-
withIssuer
Copy the current immutable object by setting a value for theissuerattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for issuer- Returns:
- A modified copy of the
thisobject
-
withIssuerNode
Copy the current immutable object by setting a value for theissuerNodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for issuerNode- Returns:
- A modified copy of the
thisobject
-
withFlags
Copy the current immutable object by setting a value for theflagsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for flags- Returns:
- A modified copy of the
thisobject
-
withPreviousTxnId
Copy the current immutable object by setting a value for thepreviousTxnIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTxnId- Returns:
- A modified copy of the
thisobject
-
withPreviousTransactionLedgerSequence
public final ImmutableCredentialObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTransactionLedgerSequence- Returns:
- A modified copy of the
thisobject
-
withCredentialType
Copy the current immutable object by setting a value for thecredentialTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for credentialType- Returns:
- A modified copy of the
thisobject
-
withUri
Copy the current immutable object by setting a present value for the optionaluriattribute.- Parameters:
value- The value for uri- Returns:
- A modified copy of
thisobject
-
withUri
Copy the current immutable object by setting an optional value for theuriattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for uri- Returns:
- A modified copy of
thisobject
-
withExpiration
public final ImmutableCredentialObject withExpiration(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalexpirationattribute.- Parameters:
value- The value for expiration- Returns:
- A modified copy of
thisobject
-
withExpiration
public final ImmutableCredentialObject withExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for theexpirationattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for expiration- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableCredentialObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,subject,subjectNode,issuer,issuerNode,flags,previousTxnId,previousTransactionLedgerSequence,credentialType,uri,expiration,index. -
toString
Prints the immutable valueCredentialObjectwith attribute values. -
copyOf
Creates an immutable copy of aCredentialObjectvalue. 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
Creates a builder forImmutableCredentialObject.ImmutableCredentialObject.builder() .subject(org.xrpl.xrpl4j.model.transactions.Address) // requiredsubject.subjectNode(String) // requiredsubjectNode.issuer(org.xrpl.xrpl4j.model.transactions.Address) // requiredissuer.issuerNode(String) // requiredissuerNode.flags(org.xrpl.xrpl4j.model.flags.CredentialFlags) // requiredflags.previousTxnId(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredpreviousTxnId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // requiredpreviousTransactionLedgerSequence.credentialType(org.xrpl.xrpl4j.model.transactions.CredentialType) // requiredcredentialType.uri(org.xrpl.xrpl4j.model.transactions.CredentialUri) // optionaluri.expiration(com.google.common.primitives.UnsignedInteger) // optionalexpiration.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableCredentialObject builder
-