it.tidalwave.util.Finder Maven / Gradle / Ivy
/***********************************************************************************************************************
*
* These Foolish Things - Miscellaneous utilities
* Copyright (C) 2009-2012 by Tidalwave s.a.s. (http://www.tidalwave.it)
*
***********************************************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
***********************************************************************************************************************
*
* WWW: http://thesefoolishthings.java.net
* SCM: https://bitbucket.org/tidalwave/thesefoolishthings-src
*
**********************************************************************************************************************/
package it.tidalwave.util;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import java.util.List;
import java.io.Serializable;
/***********************************************************************************************************************
*
* A factory for providing results of a search. {@code Finder} implementations must be immutable.
*
* @author Fabrizio Giudici
* @version $Id$
* @it.tidalwave.javadoc.draft
*
**********************************************************************************************************************/
public interface Finder extends Cloneable, Serializable
{
/*******************************************************************************************************************
*
* A tag interface to mark objects which are meaningful sort criteria that can be passed to
* {@link Finder#sort(it.tidalwave.util.Finder.SortCriterion)}. In general, a {@code SortCriterion} is just a
* behaviourless and methodless object, that should be specifically handled by concrete implementations of
* {@link Finder}. The only exceptions are {@link FilterSortCriterion} objects.
*
******************************************************************************************************************/
public static interface SortCriterion
{
//@bluebook-ignore-begin
public static final Class SortCriterion = SortCriterion.class;
/** A special {@link SortCriterion} which indicates that no sort has been performed. */
public static final SortCriterion UNSORTED = new FilterSortCriterion
© 2015 - 2025 Weber Informatics LLC | Privacy Policy