Package org.xrpl.xrpl4j.model.ledger
Class ImmutableDidObject
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableDidObject
- All Implemented Interfaces:
DidObject,LedgerObject
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableDidObject
extends Object
implements DidObject
Immutable implementation of
DidObject.
Use the builder to create immutable instances:
ImmutableDidObject.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionaccount()The account that controls the DID.static ImmutableDidObject.Builderbuilder()Creates a builder forImmutableDidObject.static ImmutableDidObjectCreates an immutable copy of aDidObjectvalue.data()The public attestations of identity credentials associated with the DID.The W3C standard DID document associated with the DID.booleanThis instance is equal to all instances ofImmutableDidObjectthat have equal attribute values.flags()A bit-map of boolean flags.inthashCode()Computes a hash code from attributes:ledgerEntryType,flags,account,didDocument,data,uri,ownerNode,previousTransactionId,previousTransactionLedgerSequence,index.index()The unique ID of theDidObject.The type of ledger object, which will always be "DID" in this case.A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.The identifying hash of the transaction that most recently modified this object.com.google.common.primitives.UnsignedIntegerThe index of the ledger that contains the transaction that most recently modified this object.toString()Prints the immutable valueDidObjectwith attribute values.uri()The Universal Resource Identifier that points to the corresponding DID document or the data associated with the DID.final ImmutableDidObjectwithAccount(Address value) Copy the current immutable object by setting a value for theaccountattribute.final ImmutableDidObjectCopy the current immutable object by setting an optional value for thedataattribute.final ImmutableDidObjectCopy the current immutable object by setting a present value for the optionaldataattribute.final ImmutableDidObjectwithDidDocument(Optional<? extends DidDocument> optional) Copy the current immutable object by setting an optional value for thedidDocumentattribute.final ImmutableDidObjectwithDidDocument(DidDocument value) Copy the current immutable object by setting a present value for the optionaldidDocumentattribute.final ImmutableDidObjectCopy the current immutable object by setting a value for theindexattribute.final ImmutableDidObjectwithOwnerNode(String value) Copy the current immutable object by setting a value for theownerNodeattribute.final ImmutableDidObjectwithPreviousTransactionId(Hash256 value) Copy the current immutable object by setting a value for thepreviousTransactionIdattribute.final ImmutableDidObjectwithPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute.final ImmutableDidObjectCopy the current immutable object by setting an optional value for theuriattribute.final ImmutableDidObjectCopy the current immutable object by setting a present value for the optionaluriattribute.
-
Method Details
-
ledgerEntryType
The type of ledger object, which will always be "DID" in this case.- Specified by:
ledgerEntryTypein interfaceDidObject- Returns:
- Always returns
LedgerObject.LedgerEntryType.DID.
-
flags
A bit-map of boolean flags. No flags are defined forDidObject, so this value is always 0.- Specified by:
flagsin interfaceDidObject- Returns:
- Always
Flags.UNSET.
-
account
The account that controls the DID. -
didDocument
The W3C standard DID document associated with the DID. This field isn't checked for validity and is limited to a maximum length of 256 bytes.- Specified by:
didDocumentin interfaceDidObject- Returns:
- An optionally-present
DidDocument.
-
data
The public attestations of identity credentials associated with the DID. This field isn't checked for validity and is limited to a maximum length of 256 bytes. -
uri
The Universal Resource Identifier that points to the corresponding DID document or the data associated with the DID. This field can be an HTTP(S) URL or IPFS URI. This field isn't checked for validity and is limited to a maximum length of 256 bytes. -
ownerNode
A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.
-
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTransactionIdin interfaceDidObject- 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 interfaceDidObject- Returns:
- An
UnsignedIntegerrepresenting the previous transaction ledger sequence.
-
index
The unique ID of theDidObject. -
withAccount
Copy the current immutable object by setting a value for theaccountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for account- Returns:
- A modified copy of the
thisobject
-
withDidDocument
Copy the current immutable object by setting a present value for the optionaldidDocumentattribute.- Parameters:
value- The value for didDocument- Returns:
- A modified copy of
thisobject
-
withDidDocument
Copy the current immutable object by setting an optional value for thedidDocumentattribute. 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 didDocument- Returns:
- A modified copy of
thisobject
-
withData
Copy the current immutable object by setting a present value for the optionaldataattribute.- Parameters:
value- The value for data- Returns:
- A modified copy of
thisobject
-
withData
Copy the current immutable object by setting an optional value for thedataattribute. 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 data- Returns:
- A modified copy of
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
-
withOwnerNode
Copy the current immutable object by setting a value for theownerNodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ownerNode- Returns:
- A modified copy of the
thisobject
-
withPreviousTransactionId
Copy the current immutable object by setting a value for thepreviousTransactionIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTransactionId- Returns:
- A modified copy of the
thisobject
-
withPreviousTransactionLedgerSequence
public final ImmutableDidObject 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
-
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 ofImmutableDidObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,flags,account,didDocument,data,uri,ownerNode,previousTransactionId,previousTransactionLedgerSequence,index. -
toString
Prints the immutable valueDidObjectwith attribute values. -
copyOf
Creates an immutable copy of aDidObjectvalue. 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 DidObject instance
-
builder
Creates a builder forImmutableDidObject.ImmutableDidObject.builder() .account(org.xrpl.xrpl4j.model.transactions.Address) // requiredaccount.didDocument(org.xrpl.xrpl4j.model.transactions.DidDocument) // optionaldidDocument.data(org.xrpl.xrpl4j.model.transactions.DidData) // optionaldata.uri(org.xrpl.xrpl4j.model.transactions.DidUri) // optionaluri.ownerNode(String) // requiredownerNode.previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredpreviousTransactionId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // requiredpreviousTransactionLedgerSequence.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableDidObject builder
-