Package org.mongojack

Class JacksonMongoCollection.JacksonMongoCollectionBuilder

    • 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
      • build

        public <CT> JacksonMongoCollection<CT> build​(com.mongodb.client.MongoClient client,
                                                     String databaseName,
                                                     String collectionName,
                                                     Class<CT> valueType,
                                                     org.bson.UuidRepresentation uuidRepresentation)
        Builds a JacksonMongoCollection. Required parameters are set here.
        Type Parameters:
        CT - The value type
        Parameters:
        client - A client
        databaseName - Name of the database the collection is in
        collectionName - Name of the collection itself
        valueType - 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 a JacksonMongoCollection. Required parameters are set here.
        Type Parameters:
        CT - The value type
        Parameters:
        client - A client
        databaseName - Name of the database the collection is in
        valueType - The class of the value type. Must be annotated with MongoCollection.
        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 a JacksonMongoCollection. Required parameters are set here.
        Type Parameters:
        CT - The value type
        Parameters:
        database - A client
        collectionName - Name of the collection itself
        valueType - 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 a JacksonMongoCollection. Required parameters are set here.
        Type Parameters:
        CT - The value type
        Parameters:
        database - A client
        valueType - The class of the value type. Must be annotated with MongoCollection.
        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 a JacksonMongoCollection. Required parameters are set here.
        Type Parameters:
        CT - The value type of the collection
        Parameters:
        mongoCollection - The underlying collection
        valueType - The value type of the collection
        Returns:
        A constructed collection