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

io.sphere.sdk.search.model.SingleValueSortSearchModel Maven / Gradle / Ivy

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

import io.sphere.sdk.search.SortExpression;

/**
 * A sort model to decide the direction of a model with just one value per resource
 * @see SingleValueSortSearchModelFactory to instantiate this class
 */
public class SingleValueSortSearchModel extends SortSearchModelImpl {

    SingleValueSortSearchModel(final SearchModel searchModel) {
        super(searchModel);
    }

    @Override
    public SortExpression byAsc() {
        return super.byAsc();
    }

    @Override
    public SortExpression byDesc() {
        return super.byDesc();
    }

    /**
     * Creates an instance of the search model to generate single-valued sort expressions.
     * @param attributePath the path of the attribute as expected by Commercetools Platform (e.g. "variants.attributes.color.key")
     * @param  type of the resource
     * @return new instance of SingleValueSortSearchModel
     */
    public static  SingleValueSortSearchModel of(final String attributePath) {
        return new SingleValueSortSearchModel<>(new SearchModelImpl<>(attributePath));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy