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

io.sphere.sdk.queries.DirectionlessQuerySort Maven / Gradle / Ivy

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

import io.sphere.sdk.models.Base;

import static io.sphere.sdk.queries.QuerySortDirection.*;

/** A sort model to decide the direction. */
public class DirectionlessQuerySort extends Base {
    private final QueryModel path;

    DirectionlessQuerySort(final QueryModel path) {
        this.path = path;
    }

    public QuerySort asc() {
        return getQuerySort(ASC);
    }

    public QuerySort desc() {
        return getQuerySort(DESC);
    }

    private QuerySort getQuerySort(final QuerySortDirection direction) {
        return new SphereQuerySort<>(path, direction);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy