Package org.xrpl.xrpl4j.codec.addresses
Class ImmutableDecodedXAddress
java.lang.Object
org.xrpl.xrpl4j.codec.addresses.ImmutableDecodedXAddress
- All Implemented Interfaces:
DecodedXAddress
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableDecodedXAddress
extends Object
implements DecodedXAddress
Immutable implementation of
DecodedXAddress
.
Use the builder to create immutable instances:
ImmutableDecodedXAddress.builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableDecodedXAddress
. -
Method Summary
Modifier and TypeMethodDescriptionThe Account ID of the X-Address.builder()
Creates a builder forImmutableDecodedXAddress
.static ImmutableDecodedXAddress
copyOf
(DecodedXAddress instance) Creates an immutable copy of aDecodedXAddress
value.boolean
This instance is equal to all instances ofImmutableDecodedXAddress
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:accountId
,tag
,test
.com.google.common.primitives.UnsignedInteger
tag()
The tag of the X-Address.boolean
test()
Whether or not this address exists on mainnet or testnet.toString()
Prints the immutable valueDecodedXAddress
with attribute values.final ImmutableDecodedXAddress
withAccountId
(UnsignedByteArray value) Copy the current immutable object by setting a value for theaccountId
attribute.final ImmutableDecodedXAddress
withTag
(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thetag
attribute.final ImmutableDecodedXAddress
withTest
(boolean value) Copy the current immutable object by setting a value for thetest
attribute.
-
Method Details
-
accountId
The Account ID of the X-Address.- Specified by:
accountId
in interfaceDecodedXAddress
- Returns:
- An
UnsignedByteArray
containing the Account ID.
-
tag
public com.google.common.primitives.UnsignedInteger tag()The tag of the X-Address.- Specified by:
tag
in interfaceDecodedXAddress
- Returns:
- An
UnsignedInteger
representing the tag.
-
test
public boolean test()Whether or not this address exists on mainnet or testnet.- Specified by:
test
in interfaceDecodedXAddress
- Returns:
true
if it is a tesnet address,false
if it is mainnet.
-
withAccountId
Copy the current immutable object by setting a value for theaccountId
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for accountId- Returns:
- A modified copy of the
this
object
-
withTag
Copy the current immutable object by setting a value for thetag
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for tag- Returns:
- A modified copy of the
this
object
-
withTest
Copy the current immutable object by setting a value for thetest
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for test- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableDecodedXAddress
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:accountId
,tag
,test
. -
toString
Prints the immutable valueDecodedXAddress
with attribute values. -
copyOf
Creates an immutable copy of aDecodedXAddress
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable DecodedXAddress instance
-
builder
Creates a builder forImmutableDecodedXAddress
.ImmutableDecodedXAddress.builder() .accountId(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required
accountId
.tag(com.google.common.primitives.UnsignedInteger) // requiredtag
.test(boolean) // requiredtest
.build();- Returns:
- A new ImmutableDecodedXAddress builder
-