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
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the type of the address. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AddressfromAccount(byte[] accountId) Creates a newAddressfrom a Stellar public key.static AddressfromContract(byte[] contractId) Creates a newAddressfrom a Stellar Contract ID.static AddressfromSCAddress(SCAddress scAddress) static AddressReturns the type of this address.byte[]getBytes()Returns the byte array of the Stellar public key or contract ID.inthashCode()Converts this object to itsSCAddressXDR object representation.toSCVal()Converts this object to itsSCValXDR object representation.toString()
-
Constructor Details
-
Address
Creates a newAddressfrom 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 newAddressfrom a Stellar public key.- Parameters:
accountId- the byte array of the Stellar public key.- Returns:
- a new
Addressobject from the given Stellar public key.
-
fromContract
Creates a newAddressfrom a Stellar Contract ID.- Parameters:
contractId- the byte array of the Stellar Contract ID.- Returns:
- a new
Addressobject from the given Stellar Contract ID.
-
fromSCAddress
-
fromSCVal
-
toSCAddress
Converts this object to itsSCAddressXDR object representation.- Returns:
- a new
SCAddressobject from this object
-
toSCVal
Converts this object to itsSCValXDR object representation.- Returns:
- a new
SCValobject 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()
-