Class JacksonMongoCollection.JacksonMongoCollectionBuilder
java.lang.Object
org.mongojack.JacksonMongoCollection.JacksonMongoCollectionBuilder
- Enclosing class:
JacksonMongoCollection<TResult>
Builder to build
JacksonMongoCollection.- Since:
- 1.0
- Author:
- James Roper
-
Method Summary
Modifier and TypeMethodDescription<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.withObjectMapper(tools.jackson.databind.ObjectMapper objectMapper) Sets the object mapper for this collection.withSerializationOptions(SerializationOptions serializationOptions) Set a view class for this collection.
-
Method Details
-
withObjectMapper
public JacksonMongoCollection.JacksonMongoCollectionBuilder withObjectMapper(tools.jackson.databind.ObjectMapper objectMapper) Sets the object mapper for this collection. Optional- Parameters:
objectMapper- The object mapper to use- Returns:
- the builder
-
withView
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
-