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

org.mongolink.domain.criteria.RestrictionEqualsToRegex Maven / Gradle / Ivy

package org.mongolink.domain.criteria;

import com.mongodb.*;

public class RestrictionEqualsToRegex extends Restriction {

    public RestrictionEqualsToRegex(final String field, final Object value) {
        super(field);
        this.value = value;
    }

    @Override
    public void apply(final DBObject query) {
        final BasicDBObject object = new BasicDBObject();
        object.put("$regex", getDBValue(value));
        query.put(getField(), object);
    }

    protected final Object value;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy