Class SCSpecEntry

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

public class SCSpecEntry extends Object implements XdrElement
SCSpecEntry's original definition in the XDR file is:
 union SCSpecEntry switch (SCSpecEntryKind kind)
 {
 case SC_SPEC_ENTRY_FUNCTION_V0:
     SCSpecFunctionV0 functionV0;
 case SC_SPEC_ENTRY_UDT_STRUCT_V0:
     SCSpecUDTStructV0 udtStructV0;
 case SC_SPEC_ENTRY_UDT_UNION_V0:
     SCSpecUDTUnionV0 udtUnionV0;
 case SC_SPEC_ENTRY_UDT_ENUM_V0:
     SCSpecUDTEnumV0 udtEnumV0;
 case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0:
     SCSpecUDTErrorEnumV0 udtErrorEnumV0;
 case SC_SPEC_ENTRY_EVENT_V0:
     SCSpecEventV0 eventV0;
 };
 
  • Constructor Details

    • SCSpecEntry

      public SCSpecEntry()
    • SCSpecEntry

      public SCSpecEntry(SCSpecEntryKind discriminant, SCSpecFunctionV0 functionV0, SCSpecUDTStructV0 udtStructV0, SCSpecUDTUnionV0 udtUnionV0, SCSpecUDTEnumV0 udtEnumV0, SCSpecUDTErrorEnumV0 udtErrorEnumV0, SCSpecEventV0 eventV0)
      Creates a new SCSpecEntry instance.
      Parameters:
      discriminant - the discriminant field value
      functionV0 - the functionV0 field value
      udtStructV0 - the udtStructV0 field value
      udtUnionV0 - the udtUnionV0 field value
      udtEnumV0 - the udtEnumV0 field value
      udtErrorEnumV0 - the udtErrorEnumV0 field value
      eventV0 - the eventV0 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 SCSpecEntry decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

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

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

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

      public static SCSpecEntry.SCSpecEntryBuilder builder()
    • toBuilder

      public SCSpecEntry.SCSpecEntryBuilder toBuilder()
    • getDiscriminant

      public SCSpecEntryKind getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getFunctionV0

      public SCSpecFunctionV0 getFunctionV0()
      Value of the functionV0 field.
      Returns:
      the functionV0 field value
    • getUdtStructV0

      public SCSpecUDTStructV0 getUdtStructV0()
      Value of the udtStructV0 field.
      Returns:
      the udtStructV0 field value
    • getUdtUnionV0

      public SCSpecUDTUnionV0 getUdtUnionV0()
      Value of the udtUnionV0 field.
      Returns:
      the udtUnionV0 field value
    • getUdtEnumV0

      public SCSpecUDTEnumV0 getUdtEnumV0()
      Value of the udtEnumV0 field.
      Returns:
      the udtEnumV0 field value
    • getUdtErrorEnumV0

      public SCSpecUDTErrorEnumV0 getUdtErrorEnumV0()
      Value of the udtErrorEnumV0 field.
      Returns:
      the udtErrorEnumV0 field value
    • getEventV0

      public SCSpecEventV0 getEventV0()
      Value of the eventV0 field.
      Returns:
      the eventV0 field value
    • setDiscriminant

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

      public void setFunctionV0(SCSpecFunctionV0 functionV0)
      Value of the functionV0 field.
      Parameters:
      functionV0 - the functionV0 field value
    • setUdtStructV0

      public void setUdtStructV0(SCSpecUDTStructV0 udtStructV0)
      Value of the udtStructV0 field.
      Parameters:
      udtStructV0 - the udtStructV0 field value
    • setUdtUnionV0

      public void setUdtUnionV0(SCSpecUDTUnionV0 udtUnionV0)
      Value of the udtUnionV0 field.
      Parameters:
      udtUnionV0 - the udtUnionV0 field value
    • setUdtEnumV0

      public void setUdtEnumV0(SCSpecUDTEnumV0 udtEnumV0)
      Value of the udtEnumV0 field.
      Parameters:
      udtEnumV0 - the udtEnumV0 field value
    • setUdtErrorEnumV0

      public void setUdtErrorEnumV0(SCSpecUDTErrorEnumV0 udtErrorEnumV0)
      Value of the udtErrorEnumV0 field.
      Parameters:
      udtErrorEnumV0 - the udtErrorEnumV0 field value
    • setEventV0

      public void setEventV0(SCSpecEventV0 eventV0)
      Value of the eventV0 field.
      Parameters:
      eventV0 - the eventV0 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