public final class ClassFilter extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
isIncluded(T candidate,
Class<? extends T>[] included,
Class<? extends T>[] excluded,
boolean includeBothEmpty)
Determines if a candidate object's type passes a set of included/excluded filters
Returns true of one of the following conditions is true
If included and excluded are both empty then the value passed as includeBothEmpty is returned
If included is not empty and excluded is empty and candidate is an instanceof a member of the included array
If included is empty and excluded is not empty and candidate is not an instanceof a member of the excluded array
If included and excluded are not empty and candidate is an instanceof a member of the included array and
candidate is not an instanceof a member of the excluded array
|
static <T> boolean |
matches(T candidate,
Class<? extends T>[] classes)
Determines if a candidate object's type matches an element in the classes array.
|
public static <T> boolean isIncluded(T candidate,
Class<? extends T>[] included,
Class<? extends T>[] excluded,
boolean includeBothEmpty)
candidate - The object to check if it is included or excludedincluded - Array of included classes, may be nullexcluded - Array of excluded classes, may be nullincludeBothEmpty - If true then if both the included and excluded arrays are null true will be returned.public static <T> boolean matches(T candidate,
Class<? extends T>[] classes)
candidate - The object to check if its type matches one of the classes in the array, must not be null.classes - List of classes to check against, may be null.Copyright © 2014. All Rights Reserved.