Package org.bson

Class 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
    • Constructor Detail

      • BsonBoolean

        public BsonBoolean​(boolean value)
        Construct a new instance with the given value.
        Parameters:
        value - the value
    • Method Detail

      • valueOf

        public static BsonBoolean valueOf​(boolean value)
        Returns a BsonBoolean instance representing the specified boolean value.
        Parameters:
        value - a boolean value.
        Returns:
        TRUE if value is true, FALSE if value is false
      • compareTo

        public int compareTo​(BsonBoolean o)
        Specified by:
        compareTo in interface java.lang.Comparable<BsonBoolean>
      • getBsonType

        public BsonType getBsonType()
        Description copied from class: BsonValue
        Gets the BSON type of this value.
        Specified by:
        getBsonType in class BsonValue
        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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object