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

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

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

import io.sphere.sdk.expansion.ReferenceExpansionDsl;

import java.util.List;

/**
 *
 * @param  type of the query result
 * @param  type of the class implementing this class
 */
public interface QueryDsl> extends EntityQuery, ReferenceExpansionDsl {

    /**
     * Returns an instance with the new predicate list as predicates.
     * @param predicates the new predicate list
     * @return instance with the predicate list
     */
    C withPredicates(final List> predicates);

    C withPredicates(final QueryPredicate predicate);


    /**
     * Returns an instance with the new predicate list appended to the existing predicates.
     * @param predicates the new predicate list
     * @return instance with the existing predicate list plus the new predicate list
     */
    C plusPredicates(final List> predicates);

    C plusPredicates(final QueryPredicate predicate);

    /**
     * Returns a query with the new sort as sort.
     * @param sort list of sorts how the results of the query should be sorted
     * @return EntityQuery with sort
     */
    C withSort(final List> sort);

    C withSort(final QuerySort sort);

    C withFetchTotal(final boolean fetchTotal);

    C withLimit(final long limit);

    /**
     * Returns a new query with the new offset as offset.
     *
     * @param offset the number of items which should be omitted in the query result.
     * @return a new query
     * @throws java.lang.IllegalArgumentException if offset is
     * not between {@value io.sphere.sdk.queries.Query#MIN_OFFSET} and {@value io.sphere.sdk.queries.Query#MAX_OFFSET}.
     */
    C withOffset(final long offset);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy