Package org.stellar.sdk
Class Address
java.lang.Object
org.stellar.sdk.Address
Represents a single address in the Stellar network. An address can represent an account or a
contract.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the type of the address. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static Address
fromAccount
(byte[] accountId) Creates a newAddress
from a Stellar public key.static Address
fromContract
(byte[] contractId) Creates a newAddress
from a Stellar Contract ID.static Address
fromSCAddress
(SCAddress scAddress) static Address
Returns the type of this address.byte[]
getBytes()
Returns the byte array of the Stellar public key or contract ID.int
hashCode()
Converts this object to itsSCAddress
XDR object representation.toSCVal()
Converts this object to itsSCVal
XDR object representation.toString()
-
Constructor Details
-
Address
Creates a newAddress
from a Stellar public key or contract ID.- Parameters:
address
- the StrKey encoded format of Stellar public key or contract ID.
-
-
Method Details
-
fromAccount
Creates a newAddress
from a Stellar public key.- Parameters:
accountId
- the byte array of the Stellar public key.- Returns:
- a new
Address
object from the given Stellar public key.
-
fromContract
Creates a newAddress
from a Stellar Contract ID.- Parameters:
contractId
- the byte array of the Stellar Contract ID.- Returns:
- a new
Address
object from the given Stellar Contract ID.
-
fromSCAddress
-
fromSCVal
-
toSCAddress
Converts this object to itsSCAddress
XDR object representation.- Returns:
- a new
SCAddress
object from this object
-
toSCVal
Converts this object to itsSCVal
XDR object representation.- Returns:
- a new
SCVal
object from this object
-
getBytes
public byte[] getBytes()Returns the byte array of the Stellar public key or contract ID.- Returns:
- the byte array of the Stellar public key or contract ID.
-
getAddressType
Returns the type of this address.- Returns:
- the type of this address.
-
toString
-
equals
-
hashCode
public int hashCode()
-