public abstract class BsonValue
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
BsonArray |
asArray()
Gets this value as a BsonArray if it is one, otherwise throws exception
|
BsonBinary |
asBinary()
Gets this value as a BsonBinary if it is one, otherwise throws exception
|
BsonBoolean |
asBoolean()
Gets this value as a BsonBoolean if it is one, otherwise throws exception
|
BsonDateTime |
asDateTime()
Gets this value as a BsonDateTime if it is one, otherwise throws exception
|
BsonDbPointer |
asDBPointer()
Gets this value as a BsonDbPointer if it is one, otherwise throws exception
|
BsonDecimal128 |
asDecimal128()
Gets this value as a BsonDecimal128 if it is one, otherwise throws exception
|
BsonDocument |
asDocument()
Gets this value as a BsonDocument if it is one, otherwise throws exception
|
BsonDouble |
asDouble()
Gets this value as a BsonDouble if it is one, otherwise throws exception
|
BsonInt32 |
asInt32()
Gets this value as a BsonInt32 if it is one, otherwise throws exception
|
BsonInt64 |
asInt64()
Gets this value as a BsonInt64 if it is one, otherwise throws exception
|
BsonJavaScript |
asJavaScript()
Gets this value as a
BsonJavaScript if it is one, otherwise throws exception |
BsonJavaScriptWithScope |
asJavaScriptWithScope()
Gets this value as a BsonJavaScriptWithScope if it is one, otherwise throws exception
|
BsonNumber |
asNumber()
Gets this value as a BsonNumber if it is one, otherwise throws exception
|
BsonObjectId |
asObjectId()
Gets this value as an BsonObjectId if it is one, otherwise throws exception
|
BsonRegularExpression |
asRegularExpression()
Gets this value as a BsonRegularExpression if it is one, otherwise throws exception
|
BsonString |
asString()
Gets this value as a BsonString if it is one, otherwise throws exception
|
BsonSymbol |
asSymbol()
Gets this value as a BsonSymbol if it is one, otherwise throws exception
|
BsonTimestamp |
asTimestamp()
Gets this value as a BsonTimestamp if it is one, otherwise throws exception
|
abstract BsonType |
getBsonType()
Gets the BSON type of this value.
|
boolean |
isArray()
Returns true if this is a BsonArray, false otherwise.
|
boolean |
isBinary()
Returns true if this is a BsonBinary, false otherwise.
|
boolean |
isBoolean()
Returns true if this is a BsonBoolean, false otherwise.
|
boolean |
isDateTime()
Returns true if this is a BsonDateTime, false otherwise.
|
boolean |
isDBPointer()
Returns true if this is a BsonDbPointer, false otherwise.
|
boolean |
isDecimal128()
Returns true if this is a BsonDecimal128, false otherwise.
|
boolean |
isDocument()
Returns true if this is a BsonDocument, false otherwise.
|
boolean |
isDouble()
Returns true if this is a BsonDouble, false otherwise.
|
boolean |
isInt32()
Returns true if this is a BsonInt32, false otherwise.
|
boolean |
isInt64()
Returns true if this is a BsonInt64, false otherwise.
|
boolean |
isJavaScript()
Returns true if this is a BsonJavaScript, false otherwise.
|
boolean |
isJavaScriptWithScope()
Returns true if this is a BsonJavaScriptWithScope, false otherwise.
|
boolean |
isNull()
Returns true if this is a BsonNull, false otherwise.
|
boolean |
isNumber()
Returns true if this is a BsonNumber, false otherwise.
|
boolean |
isObjectId()
Returns true if this is an BsonObjectId, false otherwise.
|
boolean |
isRegularExpression()
Returns true if this is a BsonRegularExpression, false otherwise.
|
boolean |
isString()
Returns true if this is a BsonString, false otherwise.
|
boolean |
isSymbol()
Returns true if this is a BsonSymbol, false otherwise.
|
boolean |
isTimestamp()
Returns true if this is a BsonTimestamp, false otherwise.
|
public abstract BsonType getBsonType()
public BsonDocument asDocument()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonArray asArray()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonString asString()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonNumber asNumber()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonInt32 asInt32()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonInt64 asInt64()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonDecimal128 asDecimal128()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonDouble asDouble()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonBoolean asBoolean()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonObjectId asObjectId()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonDbPointer asDBPointer()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonTimestamp asTimestamp()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonBinary asBinary()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonDateTime asDateTime()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonSymbol asSymbol()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonRegularExpression asRegularExpression()
BsonInvalidOperationException
- if this value is not of the expected typepublic BsonJavaScript asJavaScript()
BsonJavaScript
if it is one, otherwise throws exceptionBsonInvalidOperationException
- if this value is not of the expected typepublic BsonJavaScriptWithScope asJavaScriptWithScope()
BsonInvalidOperationException
- if this value is not of the expected typepublic boolean isNull()
public boolean isDocument()
public boolean isArray()
public boolean isString()
public boolean isNumber()
public boolean isInt32()
public boolean isInt64()
public boolean isDecimal128()
public boolean isDouble()
public boolean isBoolean()
public boolean isObjectId()
public boolean isDBPointer()
public boolean isTimestamp()
public boolean isBinary()
public boolean isDateTime()
public boolean isSymbol()
public boolean isRegularExpression()
public boolean isJavaScript()
public boolean isJavaScriptWithScope()
Copyright © 2010 - 2020 Adobe. All Rights Reserved