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

net.ravendb.client.documents.queries.facets.GenericRangeFacet Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package net.ravendb.client.documents.queries.facets;

import net.ravendb.client.documents.session.tokens.FacetToken;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

public class GenericRangeFacet extends FacetBase {

    private FacetBase _parent;

    private List> ranges;

    public GenericRangeFacet(FacetBase parent) {
        this();
        _parent = parent;
    }

    public GenericRangeFacet() {
        ranges = new ArrayList<>();
    }

    public static String parse(RangeBuilder rangeBuilder, Function addQueryParameter) {
        return rangeBuilder.getStringRepresentation(addQueryParameter);
    }

    public List> getRanges() {
        return ranges;
    }

    public void setRanges(List> ranges) {
        this.ranges = ranges;
    }

    @Override
    public FacetToken toFacetToken(Function addQueryParameter) {
        if (_parent != null) {
            return _parent.toFacetToken(addQueryParameter);
        }

        return FacetToken.create(this, addQueryParameter);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy