Class SCAddress

java.lang.Object
org.stellar.sdk.xdr.SCAddress
All Implemented Interfaces:
XdrElement

public class SCAddress extends Object implements XdrElement
SCAddress's original definition in the XDR file is:
 union SCAddress switch (SCAddressType type)
 {
 case SC_ADDRESS_TYPE_ACCOUNT:
     AccountID accountId;
 case SC_ADDRESS_TYPE_CONTRACT:
     ContractID contractId;
 case SC_ADDRESS_TYPE_MUXED_ACCOUNT:
     MuxedEd25519Account muxedAccount;
 case SC_ADDRESS_TYPE_CLAIMABLE_BALANCE:
     ClaimableBalanceID claimableBalanceId;
 case SC_ADDRESS_TYPE_LIQUIDITY_POOL:
     PoolID liquidityPoolId;
 };
 
  • Constructor Details

    • SCAddress

      public SCAddress()
    • SCAddress

      public SCAddress(SCAddressType discriminant, AccountID accountId, ContractID contractId, MuxedEd25519Account muxedAccount, ClaimableBalanceID claimableBalanceId, PoolID liquidityPoolId)
      Creates a new SCAddress instance.
      Parameters:
      discriminant - the discriminant field value
      accountId - the accountId field value
      contractId - the contractId field value
      muxedAccount - the muxedAccount field value
      claimableBalanceId - the claimableBalanceId field value
      liquidityPoolId - the liquidityPoolId field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static SCAddress decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static SCAddress decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static SCAddress fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static SCAddress fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static SCAddress fromJson(String json)
    • builder

      public static SCAddress.SCAddressBuilder builder()
    • toBuilder

      public SCAddress.SCAddressBuilder toBuilder()
    • getDiscriminant

      public SCAddressType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getAccountId

      public AccountID getAccountId()
      Value of the accountId field.
      Returns:
      the accountId field value
    • getContractId

      public ContractID getContractId()
      Value of the contractId field.
      Returns:
      the contractId field value
    • getMuxedAccount

      public MuxedEd25519Account getMuxedAccount()
      Value of the muxedAccount field.
      Returns:
      the muxedAccount field value
    • getClaimableBalanceId

      public ClaimableBalanceID getClaimableBalanceId()
      Value of the claimableBalanceId field.
      Returns:
      the claimableBalanceId field value
    • getLiquidityPoolId

      public PoolID getLiquidityPoolId()
      Value of the liquidityPoolId field.
      Returns:
      the liquidityPoolId field value
    • setDiscriminant

      public void setDiscriminant(SCAddressType discriminant)
      Value of the discriminant field.
      Parameters:
      discriminant - the discriminant field value
    • setAccountId

      public void setAccountId(AccountID accountId)
      Value of the accountId field.
      Parameters:
      accountId - the accountId field value
    • setContractId

      public void setContractId(ContractID contractId)
      Value of the contractId field.
      Parameters:
      contractId - the contractId field value
    • setMuxedAccount

      public void setMuxedAccount(MuxedEd25519Account muxedAccount)
      Value of the muxedAccount field.
      Parameters:
      muxedAccount - the muxedAccount field value
    • setClaimableBalanceId

      public void setClaimableBalanceId(ClaimableBalanceID claimableBalanceId)
      Value of the claimableBalanceId field.
      Parameters:
      claimableBalanceId - the claimableBalanceId field value
    • setLiquidityPoolId

      public void setLiquidityPoolId(PoolID liquidityPoolId)
      Value of the liquidityPoolId field.
      Parameters:
      liquidityPoolId - the liquidityPoolId field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object