Class JavaSerializer<T extends java.io.Serializable>

  • All Implemented Interfaces:
    Serializer<T>, java.io.Serializable

    public class JavaSerializer<T extends java.io.Serializable>
    extends java.lang.Object
    implements Serializer<T>, java.io.Serializable
    An implementation of Serializer that uses Java serialization.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaSerializer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(java.lang.Object other)  
      T deserialize​(java.nio.ByteBuffer serializedValue)
      Deserializes the given ByteBuffer into an event.
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.nio.ByteBuffer serialize​(T value)
      Serializes the given event.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaSerializer

        public JavaSerializer()
    • Method Detail

      • serialize

        public java.nio.ByteBuffer serialize​(T value)
        Description copied from interface: Serializer
        Serializes the given event.
        Specified by:
        serialize in interface Serializer<T extends java.io.Serializable>
        Parameters:
        value - The event to be serialized.
        Returns:
        The serialized form of the event. NOTE: buffers returned should not exceed Serializer.MAX_EVENT_SIZE.
      • deserialize

        public T deserialize​(java.nio.ByteBuffer serializedValue)
        Description copied from interface: Serializer
        Deserializes the given ByteBuffer into an event.
        Specified by:
        deserialize in interface Serializer<T extends java.io.Serializable>
        Parameters:
        serializedValue - A event that has been previously serialized.
        Returns:
        The event object.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object