Package org.xrpl.xrpl4j.wallet
Class ImmutableWallet.Builder
- java.lang.Object
-
- org.xrpl.xrpl4j.wallet.ImmutableWallet.Builder
-
- Enclosing class:
- ImmutableWallet
@NotThreadSafe public static final class ImmutableWallet.Builder extends Object
Builds instances of typeImmutableWallet
. Initialize attributes and then invoke thebuild()
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ImmutableWallet
build()
Builds a newImmutableWallet
.ImmutableWallet.Builder
classicAddress(Address classicAddress)
Initializes the value for theclassicAddress
attribute.ImmutableWallet.Builder
from(Wallet instance)
Fill a builder with attribute values from the providedWallet
instance.ImmutableWallet.Builder
isTest(boolean isTest)
Initializes the value for theisTest
attribute.ImmutableWallet.Builder
privateKey(String privateKey)
Deprecated.ImmutableWallet.Builder
privateKey(Optional<String> privateKey)
Deprecated.ImmutableWallet.Builder
publicKey(String publicKey)
Initializes the value for thepublicKey
attribute.ImmutableWallet.Builder
xAddress(XAddress xAddress)
Initializes the value for thexAddress
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableWallet.Builder from(Wallet instance)
Fill a builder with attribute values from the providedWallet
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
-
privateKey
@CanIgnoreReturnValue @Deprecated public final ImmutableWallet.Builder privateKey(String privateKey)
Deprecated.Initializes the optional valueprivateKey
to privateKey.- Parameters:
privateKey
- The value for privateKey- Returns:
this
builder for chained invocation
-
privateKey
@CanIgnoreReturnValue @Deprecated public final ImmutableWallet.Builder privateKey(Optional<String> privateKey)
Deprecated.Initializes the optional valueprivateKey
to privateKey.- Parameters:
privateKey
- The value for privateKey- Returns:
this
builder for use in a chained invocation
-
publicKey
@CanIgnoreReturnValue public final ImmutableWallet.Builder publicKey(String publicKey)
Initializes the value for thepublicKey
attribute.- Parameters:
publicKey
- The value for publicKey- Returns:
this
builder for use in a chained invocation
-
classicAddress
@CanIgnoreReturnValue public final ImmutableWallet.Builder classicAddress(Address classicAddress)
Initializes the value for theclassicAddress
attribute.- Parameters:
classicAddress
- The value for classicAddress- Returns:
this
builder for use in a chained invocation
-
xAddress
@CanIgnoreReturnValue public final ImmutableWallet.Builder xAddress(XAddress xAddress)
Initializes the value for thexAddress
attribute.- Parameters:
xAddress
- The value for xAddress- Returns:
this
builder for use in a chained invocation
-
isTest
@CanIgnoreReturnValue public final ImmutableWallet.Builder isTest(boolean isTest)
Initializes the value for theisTest
attribute.- Parameters:
isTest
- The value for isTest- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableWallet build()
Builds a newImmutableWallet
.- Returns:
- An immutable instance of Wallet
- Throws:
IllegalStateException
- if any required attributes are missing
-
-