Package org.mongojack
Enum MongoJackModuleFeature
- java.lang.Object
-
- java.lang.Enum<MongoJackModuleFeature>
-
- org.mongojack.MongoJackModuleFeature
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.cfg.ConfigFeature
,Serializable
,Comparable<MongoJackModuleFeature>
public enum MongoJackModuleFeature extends Enum<MongoJackModuleFeature> implements com.fasterxml.jackson.databind.cfg.ConfigFeature
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DISABLE_DATES_AS_TIMESTAMPS
Disable writing dates as timestampsobjectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
, because we get fewer runtime problems that way.ENABLE_BSON_VALUE_SERIALIZATION
Adds a set of serializers so that you can properly serializeBsonValue
values andBson
values in your input documents.REGISTER_JAVA_TIME
Register the java time module on configurationSET_SERIALIZATION_INCLUSION_NON_NULL
Sets the mapper's serialization inclusion to non-nullWRITE_INSTANT_AS_BSON_DATE
SerialisesInstant
s as BSON dates when nanosecond precision is disabled.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
enabledByDefault()
boolean
enabledIn(int flags)
int
getMask()
static MongoJackModuleFeature
valueOf(String name)
Returns the enum constant of this type with the specified name.static MongoJackModuleFeature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
REGISTER_JAVA_TIME
public static final MongoJackModuleFeature REGISTER_JAVA_TIME
Register the java time module on configuration
-
DISABLE_DATES_AS_TIMESTAMPS
public static final MongoJackModuleFeature DISABLE_DATES_AS_TIMESTAMPS
Disable writing dates as timestampsobjectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
, because we get fewer runtime problems that way.
-
SET_SERIALIZATION_INCLUSION_NON_NULL
public static final MongoJackModuleFeature SET_SERIALIZATION_INCLUSION_NON_NULL
Sets the mapper's serialization inclusion to non-null
-
WRITE_INSTANT_AS_BSON_DATE
public static final MongoJackModuleFeature WRITE_INSTANT_AS_BSON_DATE
SerialisesInstant
s as BSON dates when nanosecond precision is disabled.- See Also:
SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS
-
ENABLE_BSON_VALUE_SERIALIZATION
public static final MongoJackModuleFeature ENABLE_BSON_VALUE_SERIALIZATION
Adds a set of serializers so that you can properly serialize
BsonValue
values andBson
values in your input documents. Disabled because it has the potential to change expected behavior for users of the library.This feature is primarily meant so you can build aggregation pipelines or filters with embedded bson stuff and have them correctly serialize. It's theoretically possible that you could save this stuff in a POJO, but it won't be read back out correctly because type information is lost. That said, deserialization will be attempted, but only to the point of producing a simple
.Document
-
-
Method Detail
-
values
public static MongoJackModuleFeature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MongoJackModuleFeature c : MongoJackModuleFeature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MongoJackModuleFeature valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
enabledByDefault
public boolean enabledByDefault()
- Specified by:
enabledByDefault
in interfacecom.fasterxml.jackson.databind.cfg.ConfigFeature
-
getMask
public int getMask()
- Specified by:
getMask
in interfacecom.fasterxml.jackson.databind.cfg.ConfigFeature
-
enabledIn
public boolean enabledIn(int flags)
- Specified by:
enabledIn
in interfacecom.fasterxml.jackson.databind.cfg.ConfigFeature
-
-