Package org.bson
Class BsonBoolean
java.lang.Object
org.bson.BsonValue
org.bson.BsonBoolean
- All Implemented Interfaces:
Comparable<BsonBoolean>
A representation of the BSON Boolean type.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BsonBooleanThe false value.static final BsonBooleanThe true value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGets the BSON type of this value.booleangetValue()Gets the boolean value.inthashCode()toString()static BsonBooleanvalueOf(boolean value) Returns aBsonBooleaninstance representing the specifiedbooleanvalue.Methods inherited from class org.bson.BsonValue
asArray, asBinary, asBoolean, asDateTime, asDBPointer, asDecimal128, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDecimal128, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestamp
-
Field Details
-
TRUE
The true value. -
FALSE
The false value.
-
-
Constructor Details
-
BsonBoolean
public BsonBoolean(boolean value) Construct a new instance with the given value.- Parameters:
value- the value
-
-
Method Details
-
valueOf
Returns aBsonBooleaninstance representing the specifiedbooleanvalue. -
compareTo
- Specified by:
compareToin interfaceComparable<BsonBoolean>
-
getBsonType
Description copied from class:BsonValueGets the BSON type of this value.- Specified by:
getBsonTypein classBsonValue- Returns:
- the BSON type, which may not be null (but may be BSONType.NULL)
-
getValue
public boolean getValue()Gets the boolean value.- Returns:
- the value
-
equals
-
hashCode
public int hashCode() -
toString
-