com.fasterxml.jackson.databind.ser.std

## Class NumberSerializers.IntLikeSerializer

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonSerializer<T>
  - - com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
    - - com.fasterxml.jackson.databind.ser.std.StdScalarSerializer<T>
      - - com.fasterxml.jackson.databind.ser.std.NumberSerializers.Base<Number>
        - - com.fasterxml.jackson.databind.ser.std.NumberSerializers.IntLikeSerializer

- All Implemented Interfaces:
    JsonFormatVisitable, SchemaAware, ContextualSerializer, Serializable
  Enclosing class:
    NumberSerializers

      public static final class NumberSerializers.IntLikeSerializer
      extends NumberSerializers.Base<Number>

  Similar to `NumberSerializers.IntegerSerializer`, but will not cast to Integer: instead, cast is to `Number`, and conversion is by calling `Number.intValue()`.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

      `JsonSerializer.None`

  - ### Field Summary

    - ### Fields inherited from class com.fasterxml.jackson.databind.ser.std.NumberSerializers.Base

      `_isInt, _numberType, _schemaType, EMPTY_INTEGER`

    - ### Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

      `_handledType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IntLikeSerializer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isEmpty(SerializerProvider prov, Number value)` Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).
    `void` | `serialize(Number value, com.fasterxml.jackson.core.JsonGenerator gen, SerializerProvider provider)` Method that can be called to ask implementation to serialize values of type this serializer handles.

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.NumberSerializers.Base

      `acceptJsonFormatVisitor, createContextual, getSchema`

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdScalarSerializer

      `serializeWithType`

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

      `createObjectNode, createSchemaNode, createSchemaNode, findConvertingContentSerializer, findPropertyFilter, getSchema, handledType, isDefaultSerializer, wrapAndThrow, wrapAndThrow`

    - ### Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

      `getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IntLikeSerializer

          public IntLikeSerializer()

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty(SerializerProvider prov,
                                 Number value)

      Description copied from class: `JsonSerializer`
      Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

      Default implementation will consider only null values to be empty.

      NOTE: replaces `JsonSerializer.isEmpty(Object)`, deprecated in 2.5

      Overrides:
        `isEmpty` in class `JsonSerializer<Number>`

    - #### serialize

          public void serialize(Number value,
                                com.fasterxml.jackson.core.JsonGenerator gen,
                                SerializerProvider provider)
                         throws IOException

      Description copied from class: `JsonSerializer`
      Method that can be called to ask implementation to serialize values of type this serializer handles.
      Specified by:
        `serialize` in class `StdSerializer<Number>`
      Parameters:
        `value` - Value to serialize; can not be null.
        `gen` - Generator used to output resulting Json content
        `provider` - Provider that can be used to get serializers for serializing Objects value contains, if any.
      Throws:
        `IOException`

Copyright © 2014–2015 FasterXML. All rights reserved.