Package org.bson

Class BsonValue

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      BsonArray asArray()
      Deprecated.
      Gets this value as a BsonArray if it is one, otherwise throws exception
      BsonBinary asBinary()
      Deprecated.
      Gets this value as a BsonBinary if it is one, otherwise throws exception
      BsonBoolean asBoolean()
      Deprecated.
      Gets this value as a BsonBoolean if it is one, otherwise throws exception
      BsonDateTime asDateTime()
      Deprecated.
      Gets this value as a BsonDateTime if it is one, otherwise throws exception
      BsonDbPointer asDBPointer()
      Deprecated.
      Gets this value as a BsonDbPointer if it is one, otherwise throws exception
      BsonDecimal128 asDecimal128()
      Deprecated.
      Gets this value as a BsonDecimal128 if it is one, otherwise throws exception
      BsonDocument asDocument()
      Deprecated.
      Gets this value as a BsonDocument if it is one, otherwise throws exception
      BsonDouble asDouble()
      Deprecated.
      Gets this value as a BsonDouble if it is one, otherwise throws exception
      BsonInt32 asInt32()
      Deprecated.
      Gets this value as a BsonInt32 if it is one, otherwise throws exception
      BsonInt64 asInt64()
      Deprecated.
      Gets this value as a BsonInt64 if it is one, otherwise throws exception
      BsonJavaScript asJavaScript()
      Deprecated.
      Gets this value as a BsonJavaScript if it is one, otherwise throws exception
      BsonJavaScriptWithScope asJavaScriptWithScope()
      Deprecated.
      Gets this value as a BsonJavaScriptWithScope if it is one, otherwise throws exception
      BsonNumber asNumber()
      Deprecated.
      Gets this value as a BsonNumber if it is one, otherwise throws exception
      BsonObjectId asObjectId()
      Deprecated.
      Gets this value as an BsonObjectId if it is one, otherwise throws exception
      BsonRegularExpression asRegularExpression()
      Deprecated.
      Gets this value as a BsonRegularExpression if it is one, otherwise throws exception
      BsonString asString()
      Deprecated.
      Gets this value as a BsonString if it is one, otherwise throws exception
      BsonSymbol asSymbol()
      Deprecated.
      Gets this value as a BsonSymbol if it is one, otherwise throws exception
      BsonTimestamp asTimestamp()
      Deprecated.
      Gets this value as a BsonTimestamp if it is one, otherwise throws exception
      abstract BsonType getBsonType()
      Deprecated.
      Gets the BSON type of this value.
      boolean isArray()
      Deprecated.
      Returns true if this is a BsonArray, false otherwise.
      boolean isBinary()
      Deprecated.
      Returns true if this is a BsonBinary, false otherwise.
      boolean isBoolean()
      Deprecated.
      Returns true if this is a BsonBoolean, false otherwise.
      boolean isDateTime()
      Deprecated.
      Returns true if this is a BsonDateTime, false otherwise.
      boolean isDBPointer()
      Deprecated.
      Returns true if this is a BsonDbPointer, false otherwise.
      boolean isDecimal128()
      Deprecated.
      Returns true if this is a BsonDecimal128, false otherwise.
      boolean isDocument()
      Deprecated.
      Returns true if this is a BsonDocument, false otherwise.
      boolean isDouble()
      Deprecated.
      Returns true if this is a BsonDouble, false otherwise.
      boolean isInt32()
      Deprecated.
      Returns true if this is a BsonInt32, false otherwise.
      boolean isInt64()
      Deprecated.
      Returns true if this is a BsonInt64, false otherwise.
      boolean isJavaScript()
      Deprecated.
      Returns true if this is a BsonJavaScript, false otherwise.
      boolean isJavaScriptWithScope()
      Deprecated.
      Returns true if this is a BsonJavaScriptWithScope, false otherwise.
      boolean isNull()
      Deprecated.
      Returns true if this is a BsonNull, false otherwise.
      boolean isNumber()
      Deprecated.
      Returns true if this is a BsonNumber, false otherwise.
      boolean isObjectId()
      Deprecated.
      Returns true if this is an BsonObjectId, false otherwise.
      boolean isRegularExpression()
      Deprecated.
      Returns true if this is a BsonRegularExpression, false otherwise.
      boolean isString()
      Deprecated.
      Returns true if this is a BsonString, false otherwise.
      boolean isSymbol()
      Deprecated.
      Returns true if this is a BsonSymbol, false otherwise.
      boolean isTimestamp()
      Deprecated.
      Returns true if this is a BsonTimestamp, false otherwise.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getBsonType

        public abstract BsonType getBsonType()
        Deprecated.
        Gets the BSON type of this value.
        Returns:
        the BSON type, which may not be null (but may be BSONType.NULL)
      • asDocument

        public BsonDocument asDocument()
        Deprecated.
        Gets this value as a BsonDocument if it is one, otherwise throws exception
        Returns:
        a BsonDocument
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asArray

        public BsonArray asArray()
        Deprecated.
        Gets this value as a BsonArray if it is one, otherwise throws exception
        Returns:
        a BsonArray
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asString

        public BsonString asString()
        Deprecated.
        Gets this value as a BsonString if it is one, otherwise throws exception
        Returns:
        a BsonString
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asNumber

        public BsonNumber asNumber()
        Deprecated.
        Gets this value as a BsonNumber if it is one, otherwise throws exception
        Returns:
        a BsonNumber
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asInt32

        public BsonInt32 asInt32()
        Deprecated.
        Gets this value as a BsonInt32 if it is one, otherwise throws exception
        Returns:
        a BsonInt32
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asInt64

        public BsonInt64 asInt64()
        Deprecated.
        Gets this value as a BsonInt64 if it is one, otherwise throws exception
        Returns:
        a BsonInt64
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asDecimal128

        public BsonDecimal128 asDecimal128()
        Deprecated.
        Gets this value as a BsonDecimal128 if it is one, otherwise throws exception
        Returns:
        a BsonDecimal128
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
        Since:
        3.4
      • asDouble

        public BsonDouble asDouble()
        Deprecated.
        Gets this value as a BsonDouble if it is one, otherwise throws exception
        Returns:
        a BsonDouble
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asBoolean

        public BsonBoolean asBoolean()
        Deprecated.
        Gets this value as a BsonBoolean if it is one, otherwise throws exception
        Returns:
        a BsonBoolean
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asObjectId

        public BsonObjectId asObjectId()
        Deprecated.
        Gets this value as an BsonObjectId if it is one, otherwise throws exception
        Returns:
        an BsonObjectId
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asDBPointer

        public BsonDbPointer asDBPointer()
        Deprecated.
        Gets this value as a BsonDbPointer if it is one, otherwise throws exception
        Returns:
        an BsonDbPointer
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asTimestamp

        public BsonTimestamp asTimestamp()
        Deprecated.
        Gets this value as a BsonTimestamp if it is one, otherwise throws exception
        Returns:
        an BsonTimestamp
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asBinary

        public BsonBinary asBinary()
        Deprecated.
        Gets this value as a BsonBinary if it is one, otherwise throws exception
        Returns:
        an BsonBinary
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asDateTime

        public BsonDateTime asDateTime()
        Deprecated.
        Gets this value as a BsonDateTime if it is one, otherwise throws exception
        Returns:
        an BsonDateTime
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asSymbol

        public BsonSymbol asSymbol()
        Deprecated.
        Gets this value as a BsonSymbol if it is one, otherwise throws exception
        Returns:
        an BsonSymbol
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asRegularExpression

        public BsonRegularExpression asRegularExpression()
        Deprecated.
        Gets this value as a BsonRegularExpression if it is one, otherwise throws exception
        Returns:
        an BsonRegularExpression
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asJavaScript

        public BsonJavaScript asJavaScript()
        Deprecated.
        Gets this value as a BsonJavaScript if it is one, otherwise throws exception
        Returns:
        a BsonJavaScript
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • asJavaScriptWithScope

        public BsonJavaScriptWithScope asJavaScriptWithScope()
        Deprecated.
        Gets this value as a BsonJavaScriptWithScope if it is one, otherwise throws exception
        Returns:
        a BsonJavaScriptWithScope
        Throws:
        BsonInvalidOperationException - if this value is not of the expected type
      • isNull

        public boolean isNull()
        Deprecated.
        Returns true if this is a BsonNull, false otherwise.
        Returns:
        true if this is a BsonNull, false otherwise
      • isDocument

        public boolean isDocument()
        Deprecated.
        Returns true if this is a BsonDocument, false otherwise.
        Returns:
        true if this is a BsonDocument, false otherwise
      • isArray

        public boolean isArray()
        Deprecated.
        Returns true if this is a BsonArray, false otherwise.
        Returns:
        true if this is a BsonArray, false otherwise
      • isString

        public boolean isString()
        Deprecated.
        Returns true if this is a BsonString, false otherwise.
        Returns:
        true if this is a BsonString, false otherwise
      • isNumber

        public boolean isNumber()
        Deprecated.
        Returns true if this is a BsonNumber, false otherwise.
        Returns:
        true if this is a BsonNumber, false otherwise
      • isInt32

        public boolean isInt32()
        Deprecated.
        Returns true if this is a BsonInt32, false otherwise.
        Returns:
        true if this is a BsonInt32, false otherwise
      • isInt64

        public boolean isInt64()
        Deprecated.
        Returns true if this is a BsonInt64, false otherwise.
        Returns:
        true if this is a BsonInt64, false otherwise
      • isDecimal128

        public boolean isDecimal128()
        Deprecated.
        Returns true if this is a BsonDecimal128, false otherwise.
        Returns:
        true if this is a BsonDecimal128, false otherwise
        Since:
        3.4
      • isDouble

        public boolean isDouble()
        Deprecated.
        Returns true if this is a BsonDouble, false otherwise.
        Returns:
        true if this is a BsonDouble, false otherwise
      • isBoolean

        public boolean isBoolean()
        Deprecated.
        Returns true if this is a BsonBoolean, false otherwise.
        Returns:
        true if this is a BsonBoolean, false otherwise
      • isObjectId

        public boolean isObjectId()
        Deprecated.
        Returns true if this is an BsonObjectId, false otherwise.
        Returns:
        true if this is an BsonObjectId, false otherwise
      • isDBPointer

        public boolean isDBPointer()
        Deprecated.
        Returns true if this is a BsonDbPointer, false otherwise.
        Returns:
        true if this is a BsonDbPointer, false otherwise
      • isTimestamp

        public boolean isTimestamp()
        Deprecated.
        Returns true if this is a BsonTimestamp, false otherwise.
        Returns:
        true if this is a BsonTimestamp, false otherwise
      • isBinary

        public boolean isBinary()
        Deprecated.
        Returns true if this is a BsonBinary, false otherwise.
        Returns:
        true if this is a BsonBinary, false otherwise
      • isDateTime

        public boolean isDateTime()
        Deprecated.
        Returns true if this is a BsonDateTime, false otherwise.
        Returns:
        true if this is a BsonDateTime, false otherwise
      • isSymbol

        public boolean isSymbol()
        Deprecated.
        Returns true if this is a BsonSymbol, false otherwise.
        Returns:
        true if this is a BsonSymbol, false otherwise
      • isRegularExpression

        public boolean isRegularExpression()
        Deprecated.
        Returns true if this is a BsonRegularExpression, false otherwise.
        Returns:
        true if this is a BsonRegularExpression, false otherwise
      • isJavaScript

        public boolean isJavaScript()
        Deprecated.
        Returns true if this is a BsonJavaScript, false otherwise.
        Returns:
        true if this is a BsonJavaScript, false otherwise
      • isJavaScriptWithScope

        public boolean isJavaScriptWithScope()
        Deprecated.
        Returns true if this is a BsonJavaScriptWithScope, false otherwise.
        Returns:
        true if this is a BsonJavaScriptWithScope, false otherwise