Interface ValueDeserializers

All Superinterfaces:
Configurable
All Known Implementing Classes:
CommonValueDeserializers

public interface ValueDeserializers extends Configurable
Manages custom deserializers.
  • Method Details

    • hasCustomDeserializer

      <T> boolean hasCustomDeserializer(Class<T> type)
      Checks whether a custom deserializer is registered for the specified type.
      Type Parameters:
      T - Type of value
      Parameters:
      type - Type to check for custom deserializer for
      Returns:
      Whether a custom deserializer exists
    • getDeserializer

      <T> Optional<ValueDeserializer<T>> getDeserializer(DeserializationContext<T> ctx)
      Gets a custom deserializer for the specified deserialization context.
      Type Parameters:
      T - Type of the value
      Parameters:
      ctx - Context representing the deserialization
      Returns:
      Optional containing the custom deserializer registered for the specified type or an empty optional if there is none
    • registerDeserializer

      <T> void registerDeserializer(Class<T> forType, ValueDeserializer<T> deserializer)
      Registers the specified deserializer for the specified type.
      Type Parameters:
      T - Value type
      Parameters:
      forType - Type to be deserialized using the specified deserializer
      deserializer - Deserializer to register