Skip to content

Commit

Permalink
Specification<C> should be applicable to any subclass of C
Browse files Browse the repository at this point in the history
  • Loading branch information
vardlokkur committed Mar 24, 2013
1 parent 905af3d commit 2983f2e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
import javax.annotation.Nullable;

/**
* Defines the API contract for Specification.
* Defines the API contract for the Specification.
*
* @see <a href="http://en.wikipedia.org/wiki/Specification_pattern">Specification Pattern</a>
* @param <T> determines the type of candidate
*
* @param <C> determines the type of candidate
* @author Warlock, AIS.PL
* @since 1.0.1
*/
public interface Specification<T> {
public interface Specification<C> {

/**
* Verifies if this specification is matched by the candidate.
*
* @param <T> determines the upper bound for the candidate type
* @param candidate the candidate to verify
* @return {@code true} if this specification is matched by the candidate, {@code false} otherwise
*/
boolean isSatisfiedBy(@Nullable T candidate);
<T extends C> boolean isSatisfiedBy(@Nullable T candidate);

}

0 comments on commit 2983f2e

Please sign in to comment.