Package org.bson
Enum Class BsonType
- All Implemented Interfaces:
Serializable
,Comparable<BsonType>
,java.lang.constant.Constable
Enumeration of all the BSON types currently supported.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA BSON array.BSON binary data.A BSON bool.A BSON DateTime.A BSON regular expression.A BSON Decimal128.A BSON document.A BSON double.Not a real BSON type.A BSON 32-bit integer.A BSON 64-bit integer.BSON JavaScript code.BSON JavaScript code with a scope (a set of variables with values).A BSON MaxKey value.A BSON MinKey value.A BSON null value.A BSON ObjectId.A BSON regular expression.A BSON string.A BSON symbol.A BSON timestamp.A BSON undefined value. -
Method Summary
Modifier and TypeMethodDescriptionstatic BsonType
findByValue
(int value) Gets theBsonType
that corresponds to the given int value.int
getValue()
Get the int value of this BSON type.boolean
Returns whether this type is some sort of containing type, e.g.static BsonType
Returns the enum constant of this class with the specified name.static BsonType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
END_OF_DOCUMENT
Not a real BSON type. Used to signal the end of a document. -
DOUBLE
A BSON double. -
STRING
A BSON string. -
DOCUMENT
A BSON document. -
ARRAY
A BSON array. -
BINARY
BSON binary data. -
UNDEFINED
A BSON undefined value. -
OBJECT_ID
A BSON ObjectId. -
BOOLEAN
A BSON bool. -
DATE_TIME
A BSON DateTime. -
NULL
A BSON null value. -
REGULAR_EXPRESSION
A BSON regular expression. -
DB_POINTER
A BSON regular expression. -
JAVASCRIPT
BSON JavaScript code. -
SYMBOL
A BSON symbol. -
JAVASCRIPT_WITH_SCOPE
BSON JavaScript code with a scope (a set of variables with values). -
INT32
A BSON 32-bit integer. -
TIMESTAMP
A BSON timestamp. -
INT64
A BSON 64-bit integer. -
DECIMAL128
A BSON Decimal128.- Since:
- 3.4
-
MIN_KEY
A BSON MinKey value. -
MAX_KEY
A BSON MaxKey value.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public int getValue()Get the int value of this BSON type.- Returns:
- the int value of this type.
-
findByValue
Gets theBsonType
that corresponds to the given int value.- Parameters:
value
- the int value of the desired BSON type.- Returns:
- the corresponding
BsonType
-
isContainer
public boolean isContainer()Returns whether this type is some sort of containing type, e.g. a document or array.- Returns:
- true if this is some sort of containing type rather than a primitive value
-