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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableDecodedXAddress. -
Method Summary
Modifier and TypeMethodDescriptionThe Account ID of the X-Address.builder()Creates a builder forImmutableDecodedXAddress.static ImmutableDecodedXAddresscopyOf(DecodedXAddress instance) Creates an immutable copy of aDecodedXAddressvalue.booleanThis instance is equal to all instances ofImmutableDecodedXAddressthat have equal attribute values.inthashCode()Computes a hash code from attributes:accountId,tag,test.com.google.common.primitives.UnsignedIntegertag()The tag of the X-Address.booleantest()Whether or not this address exists on mainnet or testnet.toString()Prints the immutable valueDecodedXAddresswith attribute values.final ImmutableDecodedXAddresswithAccountId(UnsignedByteArray value) Copy the current immutable object by setting a value for theaccountIdattribute.final ImmutableDecodedXAddresswithTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thetagattribute.final ImmutableDecodedXAddresswithTest(boolean value) Copy the current immutable object by setting a value for thetestattribute.
-
Method Details
-
accountId
The Account ID of the X-Address.- Specified by:
accountIdin interfaceDecodedXAddress- Returns:
- An
UnsignedByteArraycontaining the Account ID.
-
tag
public com.google.common.primitives.UnsignedInteger tag()The tag of the X-Address.- Specified by:
tagin interfaceDecodedXAddress- Returns:
- An
UnsignedIntegerrepresenting the tag.
-
test
public boolean test()Whether or not this address exists on mainnet or testnet.- Specified by:
testin interfaceDecodedXAddress- Returns:
trueif it is a tesnet address,falseif it is mainnet.
-
withAccountId
Copy the current immutable object by setting a value for theaccountIdattribute. 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
thisobject
-
withTag
Copy the current immutable object by setting a value for thetagattribute. 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
thisobject
-
withTest
Copy the current immutable object by setting a value for thetestattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableDecodedXAddressthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:accountId,tag,test. -
toString
Prints the immutable valueDecodedXAddresswith attribute values. -
copyOf
Creates an immutable copy of aDecodedXAddressvalue. 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) // requiredaccountId.tag(com.google.common.primitives.UnsignedInteger) // requiredtag.test(boolean) // requiredtest.build();- Returns:
- A new ImmutableDecodedXAddress builder
-