Package org.mongojack
Class JacksonMongoCollection.JacksonMongoCollectionBuilder
- java.lang.Object
-
- org.mongojack.JacksonMongoCollection.JacksonMongoCollectionBuilder
-
- Enclosing class:
- JacksonMongoCollection<TResult>
public static final class JacksonMongoCollection.JacksonMongoCollectionBuilder extends Object
Builder to buildJacksonMongoCollection.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <CT> JacksonMongoCollection<CT>build(com.mongodb.client.MongoClient client, String databaseName, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)Builds aJacksonMongoCollection.<CT> JacksonMongoCollection<CT>build(com.mongodb.client.MongoClient client, String databaseName, String collectionName, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)Builds aJacksonMongoCollection.<CT> JacksonMongoCollection<CT>build(com.mongodb.client.MongoCollection<CT> mongoCollection, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)Builds aJacksonMongoCollection.<CT> JacksonMongoCollection<CT>build(com.mongodb.client.MongoDatabase database, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)Builds aJacksonMongoCollection.<CT> JacksonMongoCollection<CT>build(com.mongodb.client.MongoDatabase database, String collectionName, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)Builds aJacksonMongoCollection.JacksonMongoCollection.JacksonMongoCollectionBuilderwithObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Sets the object mapper for this collection.JacksonMongoCollection.JacksonMongoCollectionBuilderwithSerializationOptions(SerializationOptions serializationOptions)JacksonMongoCollection.JacksonMongoCollectionBuilderwithView(Class<?> view)Set a view class for this collection.
-
-
-
Method Detail
-
withObjectMapper
public JacksonMongoCollection.JacksonMongoCollectionBuilder withObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Sets the object mapper for this collection. Optional- Parameters:
objectMapper- The object mapper to use- Returns:
- the builder
-
withView
public JacksonMongoCollection.JacksonMongoCollectionBuilder withView(Class<?> view)
Set a view class for this collection. Optional.- Parameters:
view- The jackson view class- Returns:
- the builder
-
withSerializationOptions
public JacksonMongoCollection.JacksonMongoCollectionBuilder withSerializationOptions(SerializationOptions serializationOptions)
-
build
public <CT> JacksonMongoCollection<CT> build(com.mongodb.client.MongoClient client, String databaseName, String collectionName, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)
Builds aJacksonMongoCollection. Required parameters are set here.- Type Parameters:
CT- The value type- Parameters:
client- A clientdatabaseName- Name of the database the collection is incollectionName- Name of the collection itselfvalueType- The class of the value type- Returns:
- A constructed collection meeting the MongoCollection interface.
-
build
public <CT> JacksonMongoCollection<CT> build(com.mongodb.client.MongoClient client, String databaseName, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)
Builds aJacksonMongoCollection. Required parameters are set here.- Type Parameters:
CT- The value type- Parameters:
client- A clientdatabaseName- Name of the database the collection is invalueType- The class of the value type. Must be annotated withMongoCollection.- Returns:
- A constructed collection meeting the MongoCollection interface.
-
build
public <CT> JacksonMongoCollection<CT> build(com.mongodb.client.MongoDatabase database, String collectionName, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)
Builds aJacksonMongoCollection. Required parameters are set here.- Type Parameters:
CT- The value type- Parameters:
database- A clientcollectionName- Name of the collection itselfvalueType- The class of the value type- Returns:
- A constructed collection meeting the MongoCollection interface.
-
build
public <CT> JacksonMongoCollection<CT> build(com.mongodb.client.MongoDatabase database, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)
Builds aJacksonMongoCollection. Required parameters are set here.- Type Parameters:
CT- The value type- Parameters:
database- A clientvalueType- The class of the value type. Must be annotated withMongoCollection.- Returns:
- A constructed collection meeting the MongoCollection interface.
-
build
public <CT> JacksonMongoCollection<CT> build(com.mongodb.client.MongoCollection<CT> mongoCollection, Class<CT> valueType, org.bson.UuidRepresentation uuidRepresentation)
Builds aJacksonMongoCollection. Required parameters are set here.- Type Parameters:
CT- The value type of the collection- Parameters:
mongoCollection- The underlying collectionvalueType- The value type of the collection- Returns:
- A constructed collection
-
-