Package org.kuali.rice.krad.util
Class DataTypeUtil
java.lang.Object
org.kuali.rice.krad.util.DataTypeUtil
A utility class for determining the data type of classes and their attributes.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringdetermineDataType(Class<?> attributeType) Determines the datatype of the given class.static StringdetermineFieldDataType(Class<?> type, String attributeName) static booleanisBooleanable(Class<?> type) Determines if the given class is enough like a boolean, to index it as a String "Y" or "N"static booleanisDateLike(Class<?> type) Determines if the given class is enough like a date to store values of it as a SearchableAttributeDateTimeValuestatic booleanisDecimaltastic(Class<?> type) Determines if the given class is enough like a Float to store values of it as a SearchableAttributeFloatValuestatic booleanDetermines if the given class is enough like a "long" to store values of it as a SearchableAttributeLongValuestatic booleanDetermines if the given Class is a String
-
Method Details
-
determineFieldDataType
-
determineDataType
Determines the datatype of the given class.- Parameters:
attributeType- the class whose datatype is to be determined.- Returns:
- String representation of the datatype. Defaults to string.
-
isStringy
Determines if the given Class is a String- Parameters:
type- the class to check for Stringiness- Returns:
- true if the Class is a String, false otherwise
-
isDateLike
Determines if the given class is enough like a date to store values of it as a SearchableAttributeDateTimeValue- Parameters:
type- the class to determine the type of- Returns:
- true if it is like a date, false otherwise
-
isDecimaltastic
Determines if the given class is enough like a Float to store values of it as a SearchableAttributeFloatValue- Parameters:
type- the class to determine of the type of- Returns:
- true if it is like a "float", false otherwise
-
isIntsy
Determines if the given class is enough like a "long" to store values of it as a SearchableAttributeLongValue- Parameters:
type- the class to determine the type of- Returns:
- true if it is like a "long", false otherwise
-
isBooleanable
Determines if the given class is enough like a boolean, to index it as a String "Y" or "N"- Parameters:
type- the class to determine the type of- Returns:
- true if it is like a boolean, false otherwise
-