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

com.github.restup.query.criteria.ResourceQueryCriteria Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
package com.github.restup.query.criteria;

import java.util.List;
import com.google.common.collect.ImmutableList;

/**
 * Defines query criteria
 */
public interface ResourceQueryCriteria {

    /**
     * @param target object to filter
     * @return true if the criteria is met, false otherwise
     */
    boolean filter(Object target);

    static ResourceQueryCriteria and(ResourceQueryCriteria... criteria) {
        return and(ImmutableList.copyOf(criteria));
    }

    static ResourceQueryCriteria and(List criteria) {
        return new AndCriteria(criteria);
    }

    static ResourceQueryCriteria or(ResourceQueryCriteria... criteria) {
        return or(ImmutableList.copyOf(criteria));
    }

    static ResourceQueryCriteria or(List criteria) {
        return new OrCriteria(criteria);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy