Package rife.tools

Class ClassUtils

java.lang.Object
rife.tools.ClassUtils

public final class ClassUtils extends Object
The ClassUtils class provides useful utility methods for working with Java classes.
Since:
1.0
  • Method Details

    • isNumeric

      public static boolean isNumeric(Class klass)
      Returns true if the specified class is numeric.
      Parameters:
      klass - the class to check
      Returns:
      true if the specified class is numeric, false otherwise
      Since:
      1.0
    • isText

      public static boolean isText(Class klass)
      Returns true if the specified class is text.
      Parameters:
      klass - the class to check
      Returns:
      true if the specified class is text, false otherwise
      Since:
      1.0
    • isBasic

      public static boolean isBasic(Class klass)
      Returns true if the specified class is a basic type.
      Parameters:
      klass - the class to check
      Returns:
      true if the specified class is a basic type, false otherwise
      Since:
      1.0
    • isFromJdk

      public static boolean isFromJdk(Class klass)
      Returns true if the specified class is from the JDK.
      Parameters:
      klass - the class to check
      Returns:
      true if the specified class is from the JDK, false otherwise
      Since:
      1.0
    • simpleClassName

      public static String simpleClassName(Class klass)
      Returns the simple name of the specified class without the package name.
      Parameters:
      klass - the class whose simple name to return
      Returns:
      the simple name of the specified class
      Since:
      1.0
    • shortenClassName

      public static String shortenClassName(Class klass)
      Returns a shortened version of the specified class name, with "$" characters replaced by underscores.
      Parameters:
      klass - the class whose name to shorten
      Returns:
      a shortened version of the specified class name
      Since:
      1.0
    • getEnumClassValues

      public static String[] getEnumClassValues(Class klass)
      Returns an array of the values of the enum constants of the specified class, or null if the class is not an enum.
      Parameters:
      klass - the class whose enum constant values to return
      Returns:
      an array of the values of the enum constants of the specified class, or null if the class is not an enum
      Since:
      1.0