Package org.bson

Class BsonElement

java.lang.Object
org.bson.BsonElement

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

    • BsonElement

      public BsonElement(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 Details

    • getName

      public 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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object