Package org.xrpl.xrpl4j.crypto.signing
Class ImmutableSingleSignedTransaction<T extends Transaction>
java.lang.Object
org.xrpl.xrpl4j.crypto.signing.ImmutableSingleSignedTransaction<T>
- All Implemented Interfaces:
SignedTransaction<T>,SingleSignedTransaction<T>
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableSingleSignedTransaction<T extends Transaction>
extends Object
implements SingleSignedTransaction<T>
Immutable implementation of
SingleSignedTransaction.
Use the builder to create immutable instances:
ImmutableSingleSignedTransaction.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableSingleSignedTransaction. -
Field Summary
Fields inherited from interface org.xrpl.xrpl4j.crypto.signing.SignedTransaction
SIGNED_TRANSACTION_HASH_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Transaction>
ImmutableSingleSignedTransaction.Builder<T> builder()Creates a builder forImmutableSingleSignedTransaction.static <T extends Transaction>
ImmutableSingleSignedTransaction<T> copyOf(SingleSignedTransaction<T> instance) Creates an immutable copy of aSingleSignedTransactionvalue.booleanThis instance is equal to all instances ofImmutableSingleSignedTransactionthat have equal attribute values.hash()The hash of thesignedTransactionBytes()which can be used as a handle to the transaction even though the transaction hasn't yet been submitted to the XRP Ledger.inthashCode()Computes a hash code from attributes:unsignedTransaction,signedTransaction,signedTransactionBytes,hash,signature.The signature and public key used to sign.The transaction with a signature blob attached.ThesignedTransaction()encoded into bytes that are suitable for submission to the XRP Ledger.toString()Prints the immutable valueSingleSignedTransactionwith attribute values.The original transaction with no signature attached.withSignature(Signature value) Copy the current immutable object by setting a value for thesignatureattribute.withSignedTransaction(T value) Copy the current immutable object by setting a value for thesignedTransactionattribute.withUnsignedTransaction(T value) Copy the current immutable object by setting a value for theunsignedTransactionattribute.
-
Method Details
-
unsignedTransaction
The original transaction with no signature attached.- Specified by:
unsignedTransactionin interfaceSignedTransaction<T extends Transaction>- Returns:
- A
Transaction.
-
signedTransaction
The transaction with a signature blob attached.- Specified by:
signedTransactionin interfaceSignedTransaction<T extends Transaction>- Returns:
- A
Transaction.
-
signedTransactionBytes
ThesignedTransaction()encoded into bytes that are suitable for submission to the XRP Ledger.- Specified by:
signedTransactionBytesin interfaceSignedTransaction<T extends Transaction>- Returns:
- A byte-array containing the signed transaction blob.
-
hash
The hash of thesignedTransactionBytes()which can be used as a handle to the transaction even though the transaction hasn't yet been submitted to the XRP Ledger. This field is derived by computing the SHA512-Half of the Signed Transaction hash prefix concatenated withsignedTransactionBytes().- Specified by:
hashin interfaceSignedTransaction<T extends Transaction>- Returns:
- A
Hash256containing the transaction hash.
-
signature
The signature and public key used to sign.- Specified by:
signaturein interfaceSingleSignedTransaction<T extends Transaction>- Returns:
- A byte-array.
-
withUnsignedTransaction
Copy the current immutable object by setting a value for theunsignedTransactionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for unsignedTransaction- Returns:
- A modified copy of the
thisobject
-
withSignedTransaction
Copy the current immutable object by setting a value for thesignedTransactionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for signedTransaction- Returns:
- A modified copy of the
thisobject
-
withSignature
Copy the current immutable object by setting a value for thesignatureattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for signature- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableSingleSignedTransactionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:unsignedTransaction,signedTransaction,signedTransactionBytes,hash,signature. -
toString
Prints the immutable valueSingleSignedTransactionwith attribute values. -
copyOf
public static <T extends Transaction> ImmutableSingleSignedTransaction<T> copyOf(SingleSignedTransaction<T> instance) Creates an immutable copy of aSingleSignedTransactionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable SingleSignedTransaction instance
-
builder
Creates a builder forImmutableSingleSignedTransaction.ImmutableSingleSignedTransaction.<T>builder() .unsignedTransaction(T) // requiredunsignedTransaction.signedTransaction(T) // requiredsignedTransaction.signature(org.xrpl.xrpl4j.crypto.signing.Signature) // requiredsignature.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableSingleSignedTransaction builder
-