Class IntegerSerializer

java.lang.Object
org.ehcache.impl.serialization.IntegerSerializer
All Implemented Interfaces:
org.ehcache.spi.serialization.Serializer<Integer>

public class IntegerSerializer extends Object implements org.ehcache.spi.serialization.Serializer<Integer>
Default Serializer for Integer type. Simply writes the integer value to a byte buffer.
  • Constructor Details

    • IntegerSerializer

      public IntegerSerializer()
      No arg constructor
    • IntegerSerializer

      public IntegerSerializer(ClassLoader classLoader)
      Constructor to enable this serializer as a transient one.

      Parameter is ignored as Integer is a base java type.

      Parameters:
      classLoader - the classloader to use
      See Also:
      • Serializer
  • Method Details

    • serialize

      public ByteBuffer serialize(Integer object)
      Specified by:
      serialize in interface org.ehcache.spi.serialization.Serializer<Integer>
    • read

      public Integer read(ByteBuffer binary)
      Specified by:
      read in interface org.ehcache.spi.serialization.Serializer<Integer>
    • equals

      public boolean equals(Integer object, ByteBuffer binary)
      Specified by:
      equals in interface org.ehcache.spi.serialization.Serializer<Integer>