|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.easetech.easytest.util.GeneralUtil
public class GeneralUtil
This class contains common utils
| Constructor Summary | |
|---|---|
GeneralUtil()
|
|
| Method Summary | ||
|---|---|---|
static Boolean |
convertToBoolean(Object object)
Method to convert object to Boolean type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Byte |
convertToByte(Object object)
Method to convert object to Byte type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Character |
convertToCharacter(Object object)
Method to convert object to Character type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Double |
convertToDouble(Object object)
Method to convert object to Double type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Enum |
convertToEnum(Class idClass,
Object object)
Method to convert object to Character type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Float |
convertToFloat(Object object)
Method to convert object to Float type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Integer |
convertToInteger(Object object)
Method to convert object to Integer type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Long |
convertToLong(Object object)
Method to convert object to Long type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Short |
convertToShort(Object object)
Method to convert object to Short type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Date |
convertToSQLDate(Object object)
Method to convert object to java.sql.Date type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Time |
convertToSQLTime(Object object)
Method to convert object to java.sql.Tim type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static Timestamp |
convertToSQLTimestamp(Object object)
Method to convert object to java.sql.Timestamp type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static String |
convertToString(Object object)
Method to convert object to String type It returns toString value of object. |
|
static StringBuffer |
convertToStringBuffer(Object object)
Method to convert object to String type It returns toString value of object. |
|
static StringBuilder |
convertToStringBuilder(Object object)
Method to convert object to String type It returns toString value of object. |
|
static Object |
convertToTargetType(Class<?> idClass,
Object object)
Convert the given Class object to an object instance if possible |
|
static Date |
convertToUtilDate(Object object)
Method to convert object to java.util.Date type It checks the instance of the object is of different datatype then it gets the value from the object and casts it to required data type. |
|
static String |
createDefaultOutputFolder(String destinationFolder)
Create directory |
|
static String |
createFolder(String absoluteLocation)
Creates directory. |
|
static Boolean |
fillDataUsingConstructor(Class<?> idClass,
List<Map<String,Object>> convertFrom,
List<org.junit.experimental.theories.PotentialAssignment> finalData,
String paramName,
Collection collectionInstance)
|
|
static String |
getAbsoluteLocation(String location)
Returns absulute path of either the classpath of file location |
|
static Constructor |
getConstructor(Class<?> idClass)
|
|
static String |
getCurrentFolder()
|
|
static String |
getFormattedDate(Date date)
Format date with pattern ddMMyyyyHHmmss |
|
static Double |
getRounded(double valueToRound,
int numberOfDecimalPlaces)
Rounds a value with number of decimals |
|
static
|
handleJSONData(String expr,
Class<T> idClass,
List<org.junit.experimental.theories.PotentialAssignment> potentialAssignments)
|
|
static Boolean |
isJSON(String expression)
|
|
static boolean |
isStandardObjectInstance(Class<?> idClass)
|
|
static Boolean |
populateJSONData(Class<?> idClass,
List<Map<String,Object>> convertFrom,
List<org.junit.experimental.theories.PotentialAssignment> potentialAssignments,
String paramName)
|
|
static Boolean |
populateParamData(Class<?> idClass,
List<Map<String,Object>> convertFrom,
List<org.junit.experimental.theories.PotentialAssignment> finalData,
String paramName)
Method responsible for calling a constructor on an object to try to fill it with data. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeneralUtil()
| Method Detail |
|---|
public static Double getRounded(double valueToRound,
int numberOfDecimalPlaces)
valueToRound - numberOfDecimalPlaces -
public static String createDefaultOutputFolder(String destinationFolder)
destinationFolder -
public static String getCurrentFolder()
public static String createFolder(String absoluteLocation)
absoluteLocation -
public static String getFormattedDate(Date date)
date -
public static String getAbsoluteLocation(String location)
location -
public static Timestamp convertToSQLTimestamp(Object object)
Object - object
public static Date convertToUtilDate(Object object)
Object - object
public static Date convertToSQLDate(Object object)
Object - object
public static Time convertToSQLTime(Object object)
Object - object
public static Integer convertToInteger(Object object)
Object - object
public static Short convertToShort(Object object)
Object - object
public static Long convertToLong(Object object)
Object - object
public static Double convertToDouble(Object object)
Object - object
public static Float convertToFloat(Object object)
Object - object
public static Boolean convertToBoolean(Object object)
Object - object
public static Byte convertToByte(Object object)
Object - object
public static Character convertToCharacter(Object object)
Object - object
public static String convertToString(Object object)
Object - object
public static StringBuffer convertToStringBuffer(Object object)
Object - object
public static StringBuilder convertToStringBuilder(Object object)
Object - object
public static Enum convertToEnum(Class idClass,
Object object)
Object - object
public static Object convertToTargetType(Class<?> idClass,
Object object)
idClass - object -
public static boolean isStandardObjectInstance(Class<?> idClass)
public static Boolean populateJSONData(Class<?> idClass,
List<Map<String,Object>> convertFrom,
List<org.junit.experimental.theories.PotentialAssignment> potentialAssignments,
String paramName)
public static <T> void handleJSONData(String expr,
Class<T> idClass,
List<org.junit.experimental.theories.PotentialAssignment> potentialAssignments)
public static Boolean isJSON(String expression)
public static Boolean populateParamData(Class<?> idClass,
List<Map<String,Object>> convertFrom,
List<org.junit.experimental.theories.PotentialAssignment> finalData,
String paramName)
throws IllegalArgumentException,
InstantiationException,
IllegalAccessException,
InvocationTargetException
idClass - convertFrom - finalData - paramName -
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
public static Boolean fillDataUsingConstructor(Class<?> idClass,
List<Map<String,Object>> convertFrom,
List<org.junit.experimental.theories.PotentialAssignment> finalData,
String paramName,
Collection collectionInstance)
throws IllegalArgumentException,
InstantiationException,
IllegalAccessException,
InvocationTargetException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetExceptionpublic static Constructor getConstructor(Class<?> idClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||