public class ValueCheckerUtils extends Object
Constructor and Description |
---|
ValueCheckerUtils() |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
getArrayClassObject(TypeMirror componentType) |
static Class<?> |
getClassFromType(TypeMirror type) |
static Range |
getRangeFromValues(List<? extends Number> values)
Get the minimum and maximum of a list and return a range bounded by them.
|
static List<?> |
getValuesCastedToType(AnnotationMirror anno,
TypeMirror castTo)
Get a list of values of annotation, and then cast them to a given type
|
static <T> List<T> |
getValuesFromRange(Range range,
Class<T> expectedType)
Get all possible values from the given type and cast them into Long type, Double type, or
Character type accordingly.
|
static <T extends Comparable<T>> |
removeDuplicates(List<T> values) |
public static Class<?> getClassFromType(TypeMirror type)
public static Class<?> getArrayClassObject(TypeMirror componentType)
public static List<?> getValuesCastedToType(AnnotationMirror anno, TypeMirror castTo)
anno
- the annotation that contains valuescastTo
- the type that is casted topublic static Range getRangeFromValues(List<? extends Number> values)
public static <T> List<T> getValuesFromRange(Range range, Class<T> expectedType)
range
- the given rangeexpectedType
- the expected typepublic static <T extends Comparable<T>> List<T> removeDuplicates(List<T> values)