Package org.bson
Class BsonBoolean
- java.lang.Object
-
- org.bson.BsonValue
-
- org.bson.BsonBoolean
-
- All Implemented Interfaces:
java.lang.Comparable<BsonBoolean>
public final class BsonBoolean extends BsonValue implements java.lang.Comparable<BsonBoolean>
A representation of the BSON Boolean type.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description static BsonBoolean
FALSE
static BsonBoolean
TRUE
-
Constructor Summary
Constructors Constructor Description BsonBoolean(boolean value)
Construct a new instance with the given value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(BsonBoolean o)
boolean
equals(java.lang.Object o)
BsonType
getBsonType()
Gets the BSON type of this value.boolean
getValue()
Gets the boolean value.int
hashCode()
java.lang.String
toString()
static BsonBoolean
valueOf(boolean value)
Returns aBsonBoolean
instance representing the specifiedboolean
value.-
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 Detail
-
TRUE
public static final BsonBoolean TRUE
-
FALSE
public static final BsonBoolean FALSE
-
-
Method Detail
-
valueOf
public static BsonBoolean valueOf(boolean value)
Returns aBsonBoolean
instance representing the specifiedboolean
value.
-
compareTo
public int compareTo(BsonBoolean o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<BsonBoolean>
-
getBsonType
public BsonType getBsonType()
Description copied from class:BsonValue
Gets the BSON type of this value.- Specified by:
getBsonType
in 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
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-