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

io.sphere.sdk.search.model.SortSearchModelImpl 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.models.Base;
import io.sphere.sdk.search.SearchSortDirection;
import io.sphere.sdk.search.SortExpression;

import static io.sphere.sdk.search.SearchSortDirection.ASC;
import static io.sphere.sdk.search.SearchSortDirection.DESC;

class SortSearchModelImpl> extends Base implements SortSearchModel {
    private final SearchModel searchModel;

    SortSearchModelImpl(final SortableSearchModel searchModel) {
        this.searchModel = searchModel;
    }

    public SortExpression by(final SearchSortDirection direction) {
        return new SortExpressionImpl<>(searchModel, direction);
    }

    /**
     * @return the ascending sort direction
     */
    public SortExpression byAsc() {
        return by(ASC);
    }

    /**
     * @return the descending sort direction
     */
    public SortExpression byDesc() {
        return by(DESC);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy