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

io.sphere.internal.filters.FilterExpressionBase Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.internal.filters;

import com.google.common.base.Strings;
import io.sphere.client.filters.expressions.FilterExpression;
import io.sphere.client.filters.expressions.FilterType;

public abstract class FilterExpressionBase implements FilterExpression {
    protected final String attribute;
    protected FilterType filterType;

    protected FilterExpressionBase(String attribute) {
        if (Strings.isNullOrEmpty(attribute))
            throw new IllegalArgumentException("Attribute to filter by can't be empty.");
        this.attribute = attribute;
        this.filterType = FilterType.RESULTS_AND_FACETS;
    }

    public abstract FilterExpressionBase setFilterType(FilterType filterType);

    public String getAttributeName() { return attribute; }

    public FilterType getFilterType() { return filterType; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy