Class DataTypeUtil

java.lang.Object
org.kuali.rice.krad.util.DataTypeUtil

public class DataTypeUtil extends Object
A utility class for determining the data type of classes and their attributes.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Method Details

    • determineFieldDataType

      public static String determineFieldDataType(Class<?> type, String attributeName)
    • determineDataType

      public static String determineDataType(Class<?> attributeType)
      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

      public static boolean isStringy(Class<?> type)
      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

      public static boolean isDateLike(Class<?> type)
      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

      public static boolean isDecimaltastic(Class<?> type)
      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

      public static boolean isIntsy(Class<?> type)
      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

      public static boolean isBooleanable(Class<?> type)
      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