Class NumberSchema

java.lang.Object
io.protostuff.runtime.PolymorphicSchema
io.protostuff.runtime.NumberSchema
All Implemented Interfaces:
Schema<Object>

public abstract class NumberSchema extends PolymorphicSchema
Used when the type is Number.
  • Field Details

  • Constructor Details

    • NumberSchema

      public NumberSchema(IdStrategy strategy)
  • Method Details

    • name

      static String name(int number)
    • number

      static int number(String name)
    • getPipeSchema

      public Pipe.Schema<Object> getPipeSchema()
      Description copied from class: PolymorphicSchema
      The pipe schema associated with this schema.
      Specified by:
      getPipeSchema in class PolymorphicSchema
    • getFieldName

      public String getFieldName(int number)
      Description copied from interface: Schema
      Gets the field name associated with the number. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:
       return String.valueOf(number);
       
    • getFieldNumber

      public int getFieldNumber(String name)
      Description copied from interface: Schema
      Gets the field number associated with the name. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:
       return Integer.parseInt(name);
       
    • messageFullName

      public String messageFullName()
      Description copied from interface: Schema
      Returns the full name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getName();
    • messageName

      public String messageName()
      Description copied from interface: Schema
      Returns the simple name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getSimpleName();
    • mergeFrom

      public void mergeFrom(Input input, Object owner) throws IOException
      Description copied from interface: Schema
      Deserializes a message/object from the input.
      Throws:
      IOException
    • writeTo

      public void writeTo(Output output, Object value) throws IOException
      Description copied from interface: Schema
      Serializes a message/object to the output.
      Throws:
      IOException
    • writeObjectTo

      static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException
      Throws:
      IOException
    • readObjectFrom

      static Object readObjectFrom(Input input, Schema<?> schema, Object owner, IdStrategy strategy) throws IOException
      Throws:
      IOException
    • transferObject

      static void transferObject(Pipe.Schema<Object> pipeSchema, Pipe pipe, Input input, Output output, IdStrategy strategy) throws IOException
      Throws:
      IOException