Class SystemProperties


  • public final class SystemProperties
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getBooleanClassProperty​(java.lang.Class<?> targetClass, java.lang.String classPropertyName)  
      static boolean getBooleanClassProperty​(java.lang.Class<?> targetClass, java.lang.String classPropertyName, boolean defaultValue)  
      static java.lang.String getClassProperty​(java.lang.Class<?> targetClass, java.lang.String classPropertyName)  
      static java.lang.String getClassProperty​(java.lang.Class<?> targetClass, java.lang.String classPropertyName, java.lang.String defaultValue)
      Gets the value of a "class property".
      static int getIntegerClassProperty​(java.lang.Class<?> targetClass, java.lang.String classPropertyName, int defaultValue)  
      • Methods inherited from class java.lang.Object

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

      • getBooleanClassProperty

        public static boolean getBooleanClassProperty​(java.lang.Class<?> targetClass,
                                                      java.lang.String classPropertyName)
        Returns:
        Whether the class property is set and its value equals, ignoring case, "true"
        See Also:
        getClassProperty(Class, String, String)
      • getBooleanClassProperty

        public static boolean getBooleanClassProperty​(java.lang.Class<?> targetClass,
                                                      java.lang.String classPropertyName,
                                                      boolean defaultValue)
        Returns:
        Whether the value of the class property its value equals, ignoring case, "true", or, if that class property is not set, defaultValue
        See Also:
        getClassProperty(Class, String, String)
      • getIntegerClassProperty

        public static int getIntegerClassProperty​(java.lang.Class<?> targetClass,
                                                  java.lang.String classPropertyName,
                                                  int defaultValue)
        Returns:
        The value of the class property, converted to integer, or, if that class property is not set, defaultValue
        Throws:
        java.lang.NumberFormatException - The value of the class property could be parsed as an integer
        See Also:
        getClassProperty(Class, String, String), Integer.parseInt(String)
      • getClassProperty

        @Nullable
        public static java.lang.String getClassProperty​(java.lang.Class<?> targetClass,
                                                        java.lang.String classPropertyName)
        Returns:
        The value of the class property, or, if that class property is not set, null
        See Also:
        getClassProperty(Class, String, String)
      • getClassProperty

        @Nullable
        public static java.lang.String getClassProperty​(java.lang.Class<?> targetClass,
                                                        java.lang.String classPropertyName,
                                                        @Nullable
                                                        java.lang.String defaultValue)
        Gets the value of a "class property".

        A class property is configured by a set of system properties (decreasing priority):

        • fully-qualified-name-of-targetClass.classPropertyName
        • simple-name-of-targetClass.classPropertyName
        Returns:
        The value of the class property, or, if that class property is not set, defaultValue