Class ImmutableSingleSingedTransaction<T extends Transaction>
java.lang.Object
org.xrpl.xrpl4j.crypto.core.signing.ImmutableSingleSingedTransaction<T>
- All Implemented Interfaces:
SignedTransaction<T>
,SingleSingedTransaction<T>
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableSingleSingedTransaction<T extends Transaction>
extends Object
implements SingleSingedTransaction<T>
Immutable implementation of
SingleSingedTransaction
.
Use the builder to create immutable instances:
ImmutableSingleSingedTransaction.builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableSingleSingedTransaction
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Transaction>
ImmutableSingleSingedTransaction.Builder<T>builder()
Creates a builder forImmutableSingleSingedTransaction
.static <T extends Transaction>
ImmutableSingleSingedTransaction<T>copyOf
(SingleSingedTransaction<T> instance) Creates an immutable copy of aSingleSingedTransaction
value.boolean
This instance is equal to all instances ofImmutableSingleSingedTransaction
that have equal attribute values.hash()
The hash of theSignedTransaction.signedTransactionBytes()
which can be used as a handle to the transaction even though the transaction hasn't yet been submitted to the XRP Ledger.int
hashCode()
Computes a hash code from attributes:unsignedTransaction
,signedTransaction
,signedTransactionBytes
,signature
,hash
.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 valueSingleSingedTransaction
with attribute values.The original transaction with no signature attached.withSignature
(Signature value) Copy the current immutable object by setting a value for thesignature
attribute.withSignedTransaction
(T value) Copy the current immutable object by setting a value for thesignedTransaction
attribute.Copy the current immutable object by setting a value for thesignedTransactionBytes
attribute.withUnsignedTransaction
(T value) Copy the current immutable object by setting a value for theunsignedTransaction
attribute.
-
Method Details
-
unsignedTransaction
The original transaction with no signature attached.- Specified by:
unsignedTransaction
in interfaceSignedTransaction<T extends Transaction>
- Returns:
- A
Transaction
.
-
signedTransaction
The transaction with a signature blob attached.- Specified by:
signedTransaction
in interfaceSignedTransaction<T extends Transaction>
- Returns:
- A
Transaction
.
-
signedTransactionBytes
ThesignedTransaction()
encoded into bytes that are suitable for submission to the XRP Ledger.- Specified by:
signedTransactionBytes
in interfaceSignedTransaction<T extends Transaction>
- Returns:
- A byte-array containing the signed transaction blob.
-
signature
The signature and public key used to sign.- Specified by:
signature
in interfaceSingleSingedTransaction<T extends Transaction>
- Returns:
- A byte-array.
-
hash
Description copied from interface:SignedTransaction
The hash of theSignedTransaction.signedTransactionBytes()
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 withSignedTransaction.signedTransactionBytes()
.- Specified by:
hash
in interfaceSignedTransaction<T extends Transaction>
- Specified by:
hash
in interfaceSingleSingedTransaction<T extends Transaction>
- Returns:
- The computed-at-construction value of the
hash
attribute
-
withUnsignedTransaction
Copy the current immutable object by setting a value for theunsignedTransaction
attribute. 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
this
object
-
withSignedTransaction
Copy the current immutable object by setting a value for thesignedTransaction
attribute. 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
this
object
-
withSignedTransactionBytes
public final ImmutableSingleSingedTransaction<T> withSignedTransactionBytes(UnsignedByteArray value) Copy the current immutable object by setting a value for thesignedTransactionBytes
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for signedTransactionBytes- Returns:
- A modified copy of the
this
object
-
withSignature
Copy the current immutable object by setting a value for thesignature
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutableSingleSingedTransaction
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:unsignedTransaction
,signedTransaction
,signedTransactionBytes
,signature
,hash
. -
toString
Prints the immutable valueSingleSingedTransaction
with attribute values. -
copyOf
public static <T extends Transaction> ImmutableSingleSingedTransaction<T> copyOf(SingleSingedTransaction<T> instance) Creates an immutable copy of aSingleSingedTransaction
value. 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 SingleSingedTransaction instance
-
builder
Creates a builder forImmutableSingleSingedTransaction
.ImmutableSingleSingedTransaction.<T>builder() .unsignedTransaction(T) // required
unsignedTransaction
.signedTransaction(T) // requiredsignedTransaction
.signedTransactionBytes(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // requiredsignedTransactionBytes
.signature(org.xrpl.xrpl4j.crypto.core.signing.Signature) // requiredsignature
.build();- Type Parameters:
T
- generic parameter T- Returns:
- A new ImmutableSingleSingedTransaction builder
-