Class PrimitiveIODef

java.lang.Object
dev.quantumfusion.hyphen.codegen.def.PrimitiveIODef
All Implemented Interfaces:
SerializerDef
Direct Known Subclasses:
BoxedIODef

public class PrimitiveIODef extends Object implements SerializerDef
  • Field Details

    • primitive

      protected final Class<?> primitive
    • size

      protected final int size
  • Constructor Details

    • PrimitiveIODef

      public PrimitiveIODef(Class<?> primitive)
  • Method Details

    • getSize

      public static int getSize(Class<?> primitive)
    • writePut

      public void writePut(MethodHandler mh, Runnable valueLoad)
      Description copied from interface: SerializerDef
      Writes code for encoding the Clazz the definition is designed to handle.
      Specified by:
      writePut in interface SerializerDef
      Parameters:
      mh - A MethodHandler
      valueLoad - A Runnable which pushes the Clazz value onto the stack.
    • writeGet

      public void writeGet(MethodHandler mh)
      Description copied from interface: SerializerDef
      Writes code for decoding the Clazz the definition is designed to handle.
      Specified by:
      writeGet in interface SerializerDef
      Parameters:
      mh - A MethodHandler
    • getStaticSize

      public int getStaticSize()
      Description copied from interface: SerializerDef
      This returns the absolute minimum size of the object.
      If the size is dependent on the runtime object itself this value will be appended to the measure methods results.
      Specified by:
      getStaticSize in interface SerializerDef
      Returns:
      Object Minimum encoding size
    • hasDynamicSize

      public boolean hasDynamicSize()
      Description copied from interface: SerializerDef
      If this is true it will request to generate the Measure method.
      If this is false only the static size amount will be used.
      Specified by:
      hasDynamicSize in interface SerializerDef
      Returns:
      if it has a Dynamic Size.