Package org.xrpl.xrpl4j.crypto.signing
Class ImmutableSignedTransaction.Builder<T extends Transaction>
java.lang.Object
org.xrpl.xrpl4j.crypto.signing.ImmutableSignedTransaction.Builder<T>
- Enclosing class:
- ImmutableSignedTransaction<T extends Transaction>
@NotThreadSafe
public static final class ImmutableSignedTransaction.Builder<T extends Transaction>
extends Object
Builds instances of type
ImmutableSignedTransaction
.
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 newImmutableSignedTransaction
.from
(SignedTransaction<T> instance) Fill a builder with attribute values from the providedSignedTransaction
instance.Initializes the value for thesignature
attribute.signedTransaction
(T signedTransaction) Initializes the value for thesignedTransaction
attribute.signedTransactionBytes
(UnsignedByteArray signedTransactionBytes) Initializes the value for thesignedTransactionBytes
attribute.unsignedTransaction
(T unsignedTransaction) Initializes the value for theunsignedTransaction
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableSignedTransaction.Builder<T> from(SignedTransaction<T> instance) Fill a builder with attribute values from the providedSignedTransaction
instance. 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:
this
builder for use in a chained invocation
-
unsignedTransaction
@CanIgnoreReturnValue public final ImmutableSignedTransaction.Builder<T> unsignedTransaction(T unsignedTransaction) Initializes the value for theunsignedTransaction
attribute.- Parameters:
unsignedTransaction
- The value for unsignedTransaction- Returns:
this
builder for use in a chained invocation
-
signedTransaction
@CanIgnoreReturnValue public final ImmutableSignedTransaction.Builder<T> signedTransaction(T signedTransaction) Initializes the value for thesignedTransaction
attribute.- Parameters:
signedTransaction
- The value for signedTransaction- Returns:
this
builder for use in a chained invocation
-
signedTransactionBytes
@CanIgnoreReturnValue public final ImmutableSignedTransaction.Builder<T> signedTransactionBytes(UnsignedByteArray signedTransactionBytes) Initializes the value for thesignedTransactionBytes
attribute.- Parameters:
signedTransactionBytes
- The value for signedTransactionBytes- Returns:
this
builder for use in a chained invocation
-
signature
@CanIgnoreReturnValue public final ImmutableSignedTransaction.Builder<T> signature(Signature signature) Initializes the value for thesignature
attribute.- Parameters:
signature
- The value for signature- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableSignedTransaction
.- Returns:
- An immutable instance of SignedTransaction
- Throws:
IllegalStateException
- if any required attributes are missing
-