All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.anteros.nosql.persistence.mongodb.session.DeleteOptions Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package br.com.anteros.nosql.persistence.mongodb.session;

import com.mongodb.WriteConcern;
import com.mongodb.client.model.Collation;
import com.mongodb.client.model.DBCollectionRemoveOptions;

public final class DeleteOptions {
    private final DBCollectionRemoveOptions options = new DBCollectionRemoveOptions();

    public DeleteOptions copy() {
        DeleteOptions deleteOptions = new DeleteOptions()
            .writeConcern(getWriteConcern());

        if (getCollation() != null) {
            deleteOptions.collation(Collation.builder(getCollation()).build());
        }

        return deleteOptions;
    }

    public Collation getCollation() {
        return options.getCollation();
    }

    public DeleteOptions collation(final Collation collation) {
        options.collation(collation);
        return this;
    }

    public WriteConcern getWriteConcern() {
        return options.getWriteConcern();
    }

    public DeleteOptions writeConcern(final WriteConcern writeConcern) {
        options.writeConcern(writeConcern);
        return this;
    }

    public DBCollectionRemoveOptions getOptions() {
        return options;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy