Package org.bson

Class BsonElement


  • public class BsonElement
    extends java.lang.Object
    A mapping from a name to a BsonValue.
    Since:
    3.0
    See Also:
    BsonDocument
    • Constructor Summary

      Constructors 
      Constructor Description
      BsonElement​(java.lang.String name, BsonValue value)
      Construct a new instance with the given key and value
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getName()
      Gets the name of the key/field.
      BsonValue getValue()
      Gets the value of this element.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BsonElement

        public BsonElement​(java.lang.String name,
                           BsonValue value)
        Construct a new instance with the given key and value
        Parameters:
        name - the non-null key
        value - the non-null value
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets the name of the key/field.
        Returns:
        the name of the field.
      • getValue

        public BsonValue getValue()
        Gets the value of this element.
        Returns:
        a BsonValue containing the value of this element.
      • 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