public final class Parameters extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkNonNull(Object parameter,
String name) |
static <T,O> Collection<T> |
find(Class<T> parameterClass,
O... parameters)
Extracts multiple-value parameters of the given type from an array.
|
static <T,O> T |
find(Class<T> parameterClass,
T defaultOption,
O... parameters)
Extracts a singled-value parameter of the given type from an array.
|
public static void checkNonNull(@CheckForNull Object parameter, @Nonnull String name) throws IllegalArgumentException
IllegalArgumentException
@CheckForNull public static <T,O> T find(@Nonnull Class<T> parameterClass, @CheckForNull T defaultOption, @Nonnull O... parameters) throws IllegalArgumentException
IllegalparameterException
is thrown.parameterClass
- the class of the parameter to retrievedefaultOption
- the default value of the parameterparameters
- the array of parametersIllegalparameterException
- if more than a single value is foundIllegalArgumentException
@Nonnull public static <T,O> Collection<T> find(@Nonnull Class<T> parameterClass, @Nonnull O... parameters)
parameterClass
- the class of the parameter to retrieveparameters
- the array of parametersCopyright © 2009-2013 Tidalwave s.a.s. (http://tidalwave.it). All Rights Reserved.