Package org.bson

Class BsonJavaScript

java.lang.Object
org.bson.BsonValue
org.bson.BsonJavaScript

public class BsonJavaScript extends BsonValue
For using the JavaScript Code type.
Since:
3.0
  • Constructor Details

    • BsonJavaScript

      public BsonJavaScript(String code)
      Construct a new instance with the given JavaScript code.
      Parameters:
      code - the JavaScript code
  • Method Details

    • 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)
    • getCode

      public String getCode()
      Get the JavaScript code.
      Returns:
      the code
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object