Class JacksonFeatures

java.lang.Object
io.micronaut.jackson.codec.JacksonFeatures
All Implemented Interfaces:
JsonFeatures

@Internal public final class JacksonFeatures extends Object implements JsonFeatures
Stores features to later configure an ObjectMapper. Features are supplied through the JacksonFeatures annotation.
Since:
1.3.0
Author:
svishnyakov
  • Constructor Details

    • JacksonFeatures

      public JacksonFeatures()
      Empty jackson features.
  • Method Details

    • fromAnnotation

      public static JacksonFeatures fromAnnotation(AnnotationValue<JacksonFeatures> jacksonFeaturesAnn)
    • addFeature

      public JacksonFeatures addFeature(com.fasterxml.jackson.databind.SerializationFeature serializationFeature, boolean isEnabled)
      Add a serialization feature.
      Parameters:
      serializationFeature - serialization feature to enable/disable
      isEnabled - whether you want to turn feature on/off
      Returns:
      This object.
    • addFeature

      public JacksonFeatures addFeature(com.fasterxml.jackson.databind.DeserializationFeature deserializationFeature, boolean isEnabled)
      Add a deserialization feature.
      Parameters:
      deserializationFeature - deserialization feature to enable/disable
      isEnabled - whether you want to turn feature on/off
      Returns:
      This object.
    • addModule

      @NonNull public @NonNull JacksonFeatures addModule(@NonNull @NonNull Class<? extends com.fasterxml.jackson.databind.Module> moduleClass)
      Add a jackson module feature.
      Parameters:
      moduleClass - The module to load
      Returns:
      This object.
      Since:
      3.2
    • getSerializationFeatures

      public Map<com.fasterxml.jackson.databind.SerializationFeature,Boolean> getSerializationFeatures()
      Serialization features.
      Returns:
      Serialization features or empty map if none available.
    • getDeserializationFeatures

      public Map<com.fasterxml.jackson.databind.DeserializationFeature,Boolean> getDeserializationFeatures()
      Deserialization features.
      Returns:
      Deserialization features or empty map if none available.
    • getAdditionalModules

      @NonNull public @NonNull List<Class<? extends com.fasterxml.jackson.databind.Module>> getAdditionalModules()
      Additional modules to load.
      Returns:
      List of additional modules to load.
      Since:
      3.2
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object