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

io.sphere.sdk.search.FacetExpression Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.search;

/**
 * Facets calculate statistical counts to aid in faceted navigation.
 * @param  Type of the resource for the faceted search
 */
public interface FacetExpression {
    /**
     * returns a facet expression.
     * Example: variants.attributes.color as myColor
     * @return String with unescaped sphere facet expression
     */
    String toSearchExpression();

    /**
     * Generates the attribute path for the facet.
     * Example: variants.attributes.color
     * @return the path for the attribute to be faceted
     */
    String attributePath();

    static  FacetExpression of(final String sphereFacetExpression) {
        return new SimpleFacetExpression<>(sphereFacetExpression);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy