Package org.bson.json
Class JsonObject
- java.lang.Object
-
- org.bson.json.JsonObject
-
-
Constructor Summary
Constructors Constructor Description JsonObject(String json)Constructs a new instance with the given JSON object string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetJson()Gets the JSON object stringinthashCode()<TDocument>
BsonDocumenttoBsonDocument(Class<TDocument> documentClass, CodecRegistry registry)Render the filter into a BsonDocument.StringtoString()
-
-
-
Constructor Detail
-
JsonObject
public JsonObject(String json)
Constructs a new instance with the given JSON object string. Clients must ensure they only pass in valid JSON objects to this constructor. The constructor does not perform full validation on construction, but an invalid JsonObject can cause errors when it is used later on.- Parameters:
json- the JSON object string
-
-
Method Detail
-
getJson
public String getJson()
Gets the JSON object string- Returns:
- the JSON object string
-
toBsonDocument
public <TDocument> BsonDocument toBsonDocument(Class<TDocument> documentClass, CodecRegistry registry)
Description copied from interface:BsonRender the filter into a BsonDocument.- Specified by:
toBsonDocumentin interfaceBson- Type Parameters:
TDocument- the type of the document class- Parameters:
documentClass- the document class in scope for the collection. This parameter may be ignored, but it may be used to alter the structure of the returnedBsonDocumentbased on some knowledge of the document class.registry- the codec registry. This parameter may be ignored, but it may be used to look upCodecinstances for the document class or any other related class.- Returns:
- the BsonDocument
-
-