Class SCSpecTypeDef

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

public class SCSpecTypeDef extends Object implements XdrElement
SCSpecTypeDef's original definition in the XDR file is:
 union SCSpecTypeDef switch (SCSpecType type)
 {
 case SC_SPEC_TYPE_VAL:
 case SC_SPEC_TYPE_BOOL:
 case SC_SPEC_TYPE_VOID:
 case SC_SPEC_TYPE_ERROR:
 case SC_SPEC_TYPE_U32:
 case SC_SPEC_TYPE_I32:
 case SC_SPEC_TYPE_U64:
 case SC_SPEC_TYPE_I64:
 case SC_SPEC_TYPE_TIMEPOINT:
 case SC_SPEC_TYPE_DURATION:
 case SC_SPEC_TYPE_U128:
 case SC_SPEC_TYPE_I128:
 case SC_SPEC_TYPE_U256:
 case SC_SPEC_TYPE_I256:
 case SC_SPEC_TYPE_BYTES:
 case SC_SPEC_TYPE_STRING:
 case SC_SPEC_TYPE_SYMBOL:
 case SC_SPEC_TYPE_ADDRESS:
 case SC_SPEC_TYPE_MUXED_ADDRESS:
     void;
 case SC_SPEC_TYPE_OPTION:
     SCSpecTypeOption option;
 case SC_SPEC_TYPE_RESULT:
     SCSpecTypeResult result;
 case SC_SPEC_TYPE_VEC:
     SCSpecTypeVec vec;
 case SC_SPEC_TYPE_MAP:
     SCSpecTypeMap map;
 case SC_SPEC_TYPE_TUPLE:
     SCSpecTypeTuple tuple;
 case SC_SPEC_TYPE_BYTES_N:
     SCSpecTypeBytesN bytesN;
 case SC_SPEC_TYPE_UDT:
     SCSpecTypeUDT udt;
 };
 
  • Constructor Details

    • SCSpecTypeDef

      public SCSpecTypeDef()
    • SCSpecTypeDef

      public SCSpecTypeDef(SCSpecType discriminant, SCSpecTypeOption option, SCSpecTypeResult result, SCSpecTypeVec vec, SCSpecTypeMap map, SCSpecTypeTuple tuple, SCSpecTypeBytesN bytesN, SCSpecTypeUDT udt)
      Creates a new SCSpecTypeDef instance.
      Parameters:
      discriminant - the discriminant field value
      option - the option field value
      result - the result field value
      vec - the vec field value
      map - the map field value
      tuple - the tuple field value
      bytesN - the bytesN field value
      udt - the udt 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 SCSpecTypeDef decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

      public static SCSpecTypeDef 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 SCSpecTypeDef fromJson(String json)
    • builder

      public static SCSpecTypeDef.SCSpecTypeDefBuilder builder()
    • toBuilder

    • getDiscriminant

      public SCSpecType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getOption

      public SCSpecTypeOption getOption()
      Value of the option field.
      Returns:
      the option field value
    • getResult

      public SCSpecTypeResult getResult()
      Value of the result field.
      Returns:
      the result field value
    • getVec

      public SCSpecTypeVec getVec()
      Value of the vec field.
      Returns:
      the vec field value
    • getMap

      public SCSpecTypeMap getMap()
      Value of the map field.
      Returns:
      the map field value
    • getTuple

      public SCSpecTypeTuple getTuple()
      Value of the tuple field.
      Returns:
      the tuple field value
    • getBytesN

      public SCSpecTypeBytesN getBytesN()
      Value of the bytesN field.
      Returns:
      the bytesN field value
    • getUdt

      public SCSpecTypeUDT getUdt()
      Value of the udt field.
      Returns:
      the udt field value
    • setDiscriminant

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

      public void setOption(SCSpecTypeOption option)
      Value of the option field.
      Parameters:
      option - the option field value
    • setResult

      public void setResult(SCSpecTypeResult result)
      Value of the result field.
      Parameters:
      result - the result field value
    • setVec

      public void setVec(SCSpecTypeVec vec)
      Value of the vec field.
      Parameters:
      vec - the vec field value
    • setMap

      public void setMap(SCSpecTypeMap map)
      Value of the map field.
      Parameters:
      map - the map field value
    • setTuple

      public void setTuple(SCSpecTypeTuple tuple)
      Value of the tuple field.
      Parameters:
      tuple - the tuple field value
    • setBytesN

      public void setBytesN(SCSpecTypeBytesN bytesN)
      Value of the bytesN field.
      Parameters:
      bytesN - the bytesN field value
    • setUdt

      public void setUdt(SCSpecTypeUDT udt)
      Value of the udt field.
      Parameters:
      udt - the udt 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