Class NumberSerializers.IntLikeSerializer

All Implemented Interfaces:
JsonFormatVisitable
Enclosing class:
NumberSerializers

public static class NumberSerializers.IntLikeSerializer extends NumberSerializers.Base<Object>
Similar to NumberSerializers.IntegerSerializer, but will not cast to Integer: instead, cast is to Number, and conversion is by calling Number.intValue().
  • Constructor Details

    • IntLikeSerializer

      public IntLikeSerializer()
  • Method Details

    • serialize

      public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException
      Description copied from class: ValueSerializer
      Method that can be called to ask implementation to serialize values of type this serializer handles.
      Specified by:
      serialize in class StdSerializer<Object>
      Parameters:
      value - Value to serialize; can not be null.
      gen - Generator used to output resulting Json content
      provider - Context that can be used to get serializers for serializing Objects value contains, if any.
      Throws:
      JacksonException