Class EnumJsonWriter<T extends Enum<T>,V>

java.lang.Object
ru.tinkoff.kora.json.common.EnumJsonWriter<T,V>
All Implemented Interfaces:
JsonWriter<T>

public final class EnumJsonWriter<T extends Enum<T>,V> extends Object implements JsonWriter<T>
  • Constructor Details

    • EnumJsonWriter

      public EnumJsonWriter(T[] values, Function<T,V> valueExtractor, JsonWriter<V> valueWriter)
  • Method Details

    • write

      public void write(com.fasterxml.jackson.core.JsonGenerator gen, @Nullable T object) throws IOException
      Specified by:
      write in interface JsonWriter<T extends Enum<T>>
      Parameters:
      gen - jackson generator that will be used for writing object to JSON
      object - to serialize into JSON
      Throws:
      IOException - in case of serialization errors