@Override public CodeWithScope decode(BsonValue bsonValue) { BsonJavaScriptWithScope bsonJavaScriptWithScope = bsonValue.asJavaScriptWithScope(); return new CodeWithScope(bsonJavaScriptWithScope.getCode(), Document.parse(bsonJavaScriptWithScope.getScope().toJson())); }
@Override public BsonJavaScriptWithScope encode(CodeWithScope object) { return new BsonJavaScriptWithScope(object.getCode(), BsonDocument.parse(object.getScope().toJson())); }