Class DatatypeFeatures
- java.lang.Object
-
- com.fasterxml.jackson.databind.cfg.DatatypeFeatures
-
- All Implemented Interfaces:
java.io.Serializable
public class DatatypeFeatures extends java.lang.Object implements java.io.Serializable
Immutable value class that contains settings for multipleDatatypeFeature
enumerations.- Since:
- 2.14
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DatatypeFeatures
defaultFeatures()
java.lang.Boolean
getExplicitState(DatatypeFeature f)
Accessor for getting explicit state of given feature in this set iff explicitly set, ornull
if not explicitly set (default value)boolean
isEnabled(DatatypeFeature f)
Accessor for getting value of specified feature in this set, regardless of whether explicit defined or not (if not explicitly enabled/disabled returns default value,JacksonFeature.enabledByDefault()
.boolean
isExplicitlyDisabled(DatatypeFeature f)
Convenience method equivalent to:boolean
isExplicitlyEnabled(DatatypeFeature f)
Convenience method equivalent to:boolean
isExplicitlySet(DatatypeFeature f)
Accessor for checking whether given feature has been explicitly enabled or disabled in this set or not: if not it has the default value.DatatypeFeatures
with(DatatypeFeature f)
Mutant factory method that returns an instance with given Feature explicitly enabled.DatatypeFeatures
withFeatures(DatatypeFeature... features)
"Bulk" variant ofwith(DatatypeFeature)
which allows explicit enabling of multiple featuresDatatypeFeatures
without(DatatypeFeature f)
Mutant factory method that returns an instance with given Feature explicitly disabled.DatatypeFeatures
withoutFeatures(DatatypeFeature... features)
"Bulk" variant ofwithout(DatatypeFeature)
which allows explicit disabling of multiple features
-
-
-
Method Detail
-
defaultFeatures
public static DatatypeFeatures defaultFeatures()
-
with
public DatatypeFeatures with(DatatypeFeature f)
Mutant factory method that returns an instance with given Feature explicitly enabled.- Parameters:
f
-DatatypeFeature
to explicitly enable in this set- Returns:
- Existing instance if there is no change (feature was already explicitly enabled), or a new instance with feature explicitly enabled (if it was not).
-
withFeatures
public DatatypeFeatures withFeatures(DatatypeFeature... features)
"Bulk" variant ofwith(DatatypeFeature)
which allows explicit enabling of multiple features- Parameters:
features
-DatatypeFeature
s to explicitly enable in this set- Returns:
- Existing instance if there is no change (features were already explicitly enabled), or a new instance with features explicitly enabled (if it was not).
-
without
public DatatypeFeatures without(DatatypeFeature f)
Mutant factory method that returns an instance with given Feature explicitly disabled.- Parameters:
f
-DatatypeFeature
to explicitly disable in this set- Returns:
- Existing instance if there is no change (feature was already explicitly disabled), or a new instance with feature explicitly disabled (if it was not).
-
withoutFeatures
public DatatypeFeatures withoutFeatures(DatatypeFeature... features)
"Bulk" variant ofwithout(DatatypeFeature)
which allows explicit disabling of multiple features- Parameters:
features
-DatatypeFeature
s to explicitly disable in this set- Returns:
- Existing instance if there is no change (features were already explicitly disabled), or a new instance with features explicitly disabled (if it was not).
-
isEnabled
public boolean isEnabled(DatatypeFeature f)
Accessor for getting value of specified feature in this set, regardless of whether explicit defined or not (if not explicitly enabled/disabled returns default value,JacksonFeature.enabledByDefault()
.- Parameters:
f
- Feature to check- Returns:
- True if the specified Feature is enabled in this set either explicitly or by having enabled by default (if not explicit enabled or disabled).
-
isExplicitlySet
public boolean isExplicitlySet(DatatypeFeature f)
Accessor for checking whether given feature has been explicitly enabled or disabled in this set or not: if not it has the default value.- Parameters:
f
- Feature to check- Returns:
- Whether given feature has been explicitly set (enabled or disabled) in this set or not.
-
isExplicitlyEnabled
public boolean isExplicitlyEnabled(DatatypeFeature f)
Convenience method equivalent to:isExplicitlySet(f) && isEnabled(f)
- Parameters:
f
- Feature to check- Returns:
- Whether given feature has been explicitly enabled
- Since:
- 2.15
-
isExplicitlyDisabled
public boolean isExplicitlyDisabled(DatatypeFeature f)
Convenience method equivalent to:isExplicitlySet(f) && isDisabled(f)
- Parameters:
f
- Feature to check- Returns:
- Whether given feature has been explicitly disabled
- Since:
- 2.15
-
getExplicitState
public java.lang.Boolean getExplicitState(DatatypeFeature f)
Accessor for getting explicit state of given feature in this set iff explicitly set, ornull
if not explicitly set (default value)- Parameters:
f
- Feature to check- Returns:
Boolean.TRUE
if Feature has been explicitly enabled in this set;Boolean.FALSE
if Feature has been explicitly disabled in this set; ornull
if Feature still has its default value.
-
-