|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectit.avutils.jmapper.util.GeneralUtility
public final class GeneralUtility
Utility class that allows you to identify the type of classes given as input, to obtain name of methods starting from name of fields and more useful functions.
| Field Summary | |
|---|---|
static ArrayList<String> |
basicTypes
basicTypes contains all the names of primitive and wrapper classes |
static String |
fileSeparator
file separator of this operating system |
static org.apache.commons.collections.bidimap.DualHashBidiMap |
implementationClass
implementationClass contains the interfaces names as key and their implementation as value |
static String |
newLine
line separator of this operating system |
| Method Summary | ||
|---|---|---|
static
|
add(T collection,
E... elements)
Add elements to collection. |
|
static boolean |
areArrays(Class<?> dClass,
Class<?> sClass)
Returns true if both classes are of Array type, false otherwise. |
|
static boolean |
areBasic(Class<?> dClass,
Class<?> sClass)
Returns true if both classes are of base type, false otherwise. |
|
static boolean |
areCollections(Class<?> dClass,
Class<?> sClass)
Returns true if both classes are of Collection type, false otherwise. |
|
static boolean |
areMaps(Class<?> dClass,
Class<?> sClass)
Returns true if both classes are of Map type, false otherwise. |
|
static boolean |
collectionIsAssignableFrom(Class<?> aClass)
Determines if the Collection interface is either the same as, or is a superinterface of, the class or interface represented by the specified Class parameter. |
|
static boolean |
containsAll(String line,
String... elements)
This method verifies that the line contains all elements. |
|
static
|
enrichList(List<T> aListToEnrich,
T[] anArrayToAdd)
Enriches the specified aListToEnrich parameter with the specified anArrayToAdd parameter. |
|
static String |
getMethod(Class<?> clazz,
String field)
if clazz is a boolean, this method calls mIs(field), in other cases this method calls the mGet(field) |
|
static boolean |
isAccessModifier(String str)
Returns true if str is an access modifier, false otherwise. |
|
static boolean |
isArray(Class<?> aClass)
Determines if the specified Class parameter represents an array class. |
|
static boolean |
isBasic(Class<?> aClass)
Returns true if aClass is a wrapper or primitive class, false otherwise. |
|
static boolean |
isStructure(Class<?> aClass)
Returns true if the specified Class parameter is a Collection, Map or Array, false otherwise. |
|
static boolean |
listIsAssignableFrom(Class<?> aClass)
Determines if the List interface is either the same as, or is a superinterface of, the class or interface represented by the specified Class parameter. |
|
static boolean |
mapIsAssignableFrom(Class<?> aClass)
Determines if the Map interface is either the same as, or is a superinterface of, the class or interface represented by the specified Class parameter. |
|
static String |
mGet(String fieldName)
|
|
static String |
mIs(String fieldName)
|
|
static String |
mSet(String fieldName)
|
|
static boolean |
setIsAssignableFrom(Class<?> aClass)
Determines if the Set interface is either the same as, or is a superinterface of, the class or interface represented by the specified Class parameter. |
|
static boolean |
sortedSetIsAssignableFrom(Class<?> aClass)
Determines if the SortedSet interface is either the same as, or is a superinterface of, the class or interface represented by the specified Class parameter. |
|
static
|
toList(T[] anArrayToConvert)
Returns a list equivalent to the array given as input. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String newLine
public static final String fileSeparator
public static final org.apache.commons.collections.bidimap.DualHashBidiMap implementationClass
public static final ArrayList<String> basicTypes
| Method Detail |
|---|
public static boolean isBasic(Class<?> aClass)
aClass -
public static boolean isAccessModifier(String str)
str -
public static <T> List<T> toList(T[] anArrayToConvert)
anArrayToConvert - a generic Array to convert in a List
public static <T> void enrichList(List<T> aListToEnrich,
T[] anArrayToAdd)
aListToEnrich - a List to enrichanArrayToAdd - an array to addpublic static boolean isStructure(Class<?> aClass)
aClass -
collectionIsAssignableFrom,
mapIsAssignableFrom,
isArray
public static boolean areBasic(Class<?> dClass,
Class<?> sClass)
dClass - class to analyzesClass - class to analyze
public static boolean areArrays(Class<?> dClass,
Class<?> sClass)
dClass - class to analyzesClass - class to analyze
public static boolean areCollections(Class<?> dClass,
Class<?> sClass)
dClass - class to analyzesClass - class to analyze
public static boolean areMaps(Class<?> dClass,
Class<?> sClass)
dClass - class to analyzesClass - class to analyze
public static boolean collectionIsAssignableFrom(Class<?> aClass)
aClass - the Class to be checked
public static boolean mapIsAssignableFrom(Class<?> aClass)
aClass - the Class to be checked
public static boolean listIsAssignableFrom(Class<?> aClass)
aClass - the Class to be checked
public static boolean setIsAssignableFrom(Class<?> aClass)
aClass - the Class to be checked
public static boolean sortedSetIsAssignableFrom(Class<?> aClass)
aClass - the Class to be checked
public static boolean isArray(Class<?> aClass)
aClass - the Class to be checked
public static String mGet(String fieldName)
fieldName -
public static String mSet(String fieldName)
fieldName -
public static String mIs(String fieldName)
fieldName -
public static String getMethod(Class<?> clazz,
String field)
clazz - field -
mIs(String),
mGet(String)
public static <T extends Collection<E>,E> T add(T collection,
E... elements)
collection - to enrichelements - to be added
public static boolean containsAll(String line,
String... elements)
line - line to checkelements - elements to check
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||