Package org.xrpl.xrpl4j.model.ledger
Class ImmutableCredentialObject.Builder
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableCredentialObject.Builder
- Enclosing class:
ImmutableCredentialObject
Builds instances of type
ImmutableCredentialObject.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableCredentialObject.credentialType(CredentialType credentialType) Initializes the value for thecredentialTypeattribute.expiration(com.google.common.primitives.UnsignedInteger expiration) Initializes the optional valueexpirationto expiration.expiration(Optional<? extends com.google.common.primitives.UnsignedInteger> expiration) Initializes the optional valueexpirationto expiration.flags(CredentialFlags flags) Initializes the value for theflagsattribute.from(CredentialObject instance) Fill a builder with attribute values from the providedCredentialObjectinstance.Initializes the value for theindexattribute.Initializes the value for theissuerattribute.issuerNode(String issuerNode) Initializes the value for theissuerNodeattribute.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence) Initializes the value for thepreviousTransactionLedgerSequenceattribute.previousTxnId(Hash256 previousTxnId) Initializes the value for thepreviousTxnIdattribute.Initializes the value for thesubjectattribute.subjectNode(String subjectNode) Initializes the value for thesubjectNodeattribute.uri(Optional<? extends CredentialUri> uri) Initializes the optional valueurito uri.uri(CredentialUri uri) Initializes the optional valueurito uri.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder from(CredentialObject instance) Fill a builder with attribute values from the providedCredentialObjectinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
subject
Initializes the value for thesubjectattribute.- Parameters:
subject- The value for subject- Returns:
thisbuilder for use in a chained invocation
-
subjectNode
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder subjectNode(String subjectNode) Initializes the value for thesubjectNodeattribute.- Parameters:
subjectNode- The value for subjectNode- Returns:
thisbuilder for use in a chained invocation
-
issuer
Initializes the value for theissuerattribute.- Parameters:
issuer- The value for issuer- Returns:
thisbuilder for use in a chained invocation
-
issuerNode
Initializes the value for theissuerNodeattribute.- Parameters:
issuerNode- The value for issuerNode- Returns:
thisbuilder for use in a chained invocation
-
flags
Initializes the value for theflagsattribute.- Parameters:
flags- The value for flags- Returns:
thisbuilder for use in a chained invocation
-
previousTxnId
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder previousTxnId(Hash256 previousTxnId) Initializes the value for thepreviousTxnIdattribute.- Parameters:
previousTxnId- The value for previousTxnId- Returns:
thisbuilder for use in a chained invocation
-
previousTransactionLedgerSequence
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence) Initializes the value for thepreviousTransactionLedgerSequenceattribute.- Parameters:
previousTransactionLedgerSequence- The value for previousTransactionLedgerSequence- Returns:
thisbuilder for use in a chained invocation
-
credentialType
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder credentialType(CredentialType credentialType) Initializes the value for thecredentialTypeattribute.- Parameters:
credentialType- The value for credentialType- Returns:
thisbuilder for use in a chained invocation
-
uri
Initializes the optional valueurito uri.- Parameters:
uri- The value for uri- Returns:
thisbuilder for chained invocation
-
uri
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder uri(Optional<? extends CredentialUri> uri) Initializes the optional valueurito uri.- Parameters:
uri- The value for uri- Returns:
thisbuilder for use in a chained invocation
-
expiration
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder expiration(com.google.common.primitives.UnsignedInteger expiration) Initializes the optional valueexpirationto expiration.- Parameters:
expiration- The value for expiration- Returns:
thisbuilder for chained invocation
-
expiration
@CanIgnoreReturnValue public final ImmutableCredentialObject.Builder expiration(Optional<? extends com.google.common.primitives.UnsignedInteger> expiration) Initializes the optional valueexpirationto expiration.- Parameters:
expiration- The value for expiration- Returns:
thisbuilder for use in a chained invocation
-
index
Initializes the value for theindexattribute.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableCredentialObject.- Returns:
- An immutable instance of CredentialObject
- Throws:
IllegalStateException- if any required attributes are missing
-