Class ToStringKeySerializer

java.lang.Object
org.dominokit.jacksonapt.ser.map.key.KeySerializer<java.lang.Object>
org.dominokit.jacksonapt.ser.map.key.ToStringKeySerializer

public final class ToStringKeySerializer
extends KeySerializer<java.lang.Object>
KeySerializer implementation that uses Object.toString() method.
Version:
$Id: $
Author:
Nicolas Morel
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.String doSerialize​(java.lang.Object value, JsonSerializationContext ctx)
    Serializes a non-null object into a String to use as map's key.
    static ToStringKeySerializer getInstance()
    getInstance

    Methods inherited from class org.dominokit.jacksonapt.ser.map.key.KeySerializer

    mustBeEscaped, serialize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static ToStringKeySerializer getInstance()

      getInstance

      Returns:
      an instance of ToStringKeySerializer
    • doSerialize

      protected java.lang.String doSerialize​(java.lang.Object value, JsonSerializationContext ctx)
      Serializes a non-null object into a String to use as map's key.
      Specified by:
      doSerialize in class KeySerializer<java.lang.Object>
      Parameters:
      value - Object to serialize
      ctx - Context for the full serialization process
      Returns:
      the key