Class CommonUtil


  • public class CommonUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CommonUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isDigit​(java.lang.String text)  
      static boolean isDouble​(java.lang.String text)  
      static <T extends java.lang.Enum<T>>
      boolean
      isEnum​(java.lang.String name, java.lang.Class<T> enumType)  
      static boolean isFloat​(java.lang.String text)  
      static boolean isInteger​(java.lang.String text)  
      static int parseInt​(java.lang.String intValue, int defaultValue)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommonUtil

        public CommonUtil()
    • Method Detail

      • parseInt

        public static int parseInt​(java.lang.String intValue,
                                   int defaultValue)
        Parameters:
        intValue -
        defaultValue -
        Returns:
        intValue as int if its valid integer value, defaultValue otherwise
      • isDigit

        public static boolean isDigit​(java.lang.String text)
        Parameters:
        text -
        Returns:
        true if text can be parsed as long, false
      • isInteger

        public static boolean isInteger​(java.lang.String text)
        Parameters:
        text - - the text to check
        Returns:
        true if text is integer, false otherwise
      • isFloat

        public static boolean isFloat​(java.lang.String text)
        Parameters:
        text - - the text to check
        Returns:
        true if text is float, false otherwise
      • isDouble

        public static boolean isDouble​(java.lang.String text)
        Parameters:
        text - - the text to check
        Returns:
        true if text is double, false otherwise
      • isEnum

        public static <T extends java.lang.Enum<T>> boolean isEnum​(java.lang.String name,
                                                                   java.lang.Class<T> enumType)
        Type Parameters:
        T -
        Parameters:
        name - - the text to check
        enumType -
        Returns:
        true if text is enum, false otherwise