Class ImmutableWallet

    • Method Detail

      • privateKey

        public Optional<String> privateKey()
        The private key of the wallet, encoded in hexadecimal.
        Specified by:
        privateKey in interface Wallet
        Returns:
        An optionally present String containing a private key.
      • publicKey

        public String publicKey()
        The public key of the wallet, encoded in hexadecimal.
        Specified by:
        publicKey in interface Wallet
        Returns:
        A String containing a public key.
      • classicAddress

        public Address classicAddress()
        The XRPL address of this wallet, in the Classic Address form.
        Specified by:
        classicAddress in interface Wallet
        Returns:
        The classic Address of this wallet.
      • xAddress

        public String xAddress()
        The XRPL address of this wallet, in the X-Address form.
        Specified by:
        xAddress in interface Wallet
        Returns:
        A String containing the X-Address of this wallet.
      • isTest

        public boolean isTest()
        Whether or not this wallet is on XRPL testnet or mainnet.
        Specified by:
        isTest in interface Wallet
        Returns:
        A boolean indicating if this is a testnet or mainnet wallet.
      • withPrivateKey

        public final ImmutableWallet withPrivateKey​(String value)
        Copy the current immutable object by setting a present value for the optional privateKey attribute.
        Parameters:
        value - The value for privateKey
        Returns:
        A modified copy of this object
      • withPrivateKey

        public final ImmutableWallet withPrivateKey​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the privateKey attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for privateKey
        Returns:
        A modified copy of this object
      • withPublicKey

        public final ImmutableWallet withPublicKey​(String value)
        Copy the current immutable object by setting a value for the publicKey attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for publicKey
        Returns:
        A modified copy of the this object
      • withClassicAddress

        public final ImmutableWallet withClassicAddress​(Address value)
        Copy the current immutable object by setting a value for the classicAddress attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for classicAddress
        Returns:
        A modified copy of the this object
      • withXAddress

        public final ImmutableWallet withXAddress​(String value)
        Copy the current immutable object by setting a value for the xAddress attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for xAddress
        Returns:
        A modified copy of the this object
      • withIsTest

        public final ImmutableWallet withIsTest​(boolean value)
        Copy the current immutable object by setting a value for the isTest attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for isTest
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableWallet that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: privateKey, publicKey, classicAddress, xAddress, isTest.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value Wallet with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableWallet copyOf​(Wallet instance)
        Creates an immutable copy of a Wallet 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 Wallet instance