Package io.micronaut.jackson.codec
Class JacksonFeatures
java.lang.Object
io.micronaut.jackson.codec.JacksonFeatures
- All Implemented Interfaces:
JsonFeatures
Stores features to later configure an
ObjectMapper
.
Features are supplied through the JacksonFeatures
annotation.- Since:
- 1.3.0
- Author:
- svishnyakov
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddFeature
(com.fasterxml.jackson.databind.DeserializationFeature deserializationFeature, boolean isEnabled) Add a deserialization feature.addFeature
(com.fasterxml.jackson.databind.SerializationFeature serializationFeature, boolean isEnabled) Add a serialization feature.Add a jackson module feature.boolean
static JacksonFeatures
fromAnnotation
(AnnotationValue<JacksonFeatures> jacksonFeaturesAnn) Additional modules to load.Deserialization features.Serialization features.int
hashCode()
-
Constructor Details
-
JacksonFeatures
public JacksonFeatures()Empty jackson features.
-
-
Method Details
-
fromAnnotation
-
addFeature
public JacksonFeatures addFeature(com.fasterxml.jackson.databind.SerializationFeature serializationFeature, boolean isEnabled) Add a serialization feature.- Parameters:
serializationFeature
- serialization feature to enable/disableisEnabled
- 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/disableisEnabled
- 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
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
-
hashCode
public int hashCode()
-