Module de.carne
Package de.carne.util

Class SystemProperties


  • public final class SystemProperties
    extends java.lang.Object
    Utility class providing system properties related functions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean booleanValue​(java.lang.Class<?> clazz, java.lang.String key)
      Gets a boolean system property value.
      static boolean booleanValue​(java.lang.Class<?> clazz, java.lang.String key, boolean defaultValue)
      Gets a boolean system property value.
      static boolean booleanValue​(java.lang.String key)
      Gets a boolean system property value.
      static boolean booleanValue​(java.lang.String key, boolean defaultValue)
      Gets a boolean system property value.
      static int intValue​(java.lang.Class<?> clazz, java.lang.String key)
      Gets a int system property value.
      static int intValue​(java.lang.Class<?> clazz, java.lang.String key, int defaultValue)
      Gets a int system property value.
      static int intValue​(java.lang.Class<?> clazz, java.lang.String key, IntegerParser parser, int defaultValue)
      Gets a int system property value.
      static int intValue​(java.lang.String key)
      Gets a int system property value.
      static int intValue​(java.lang.String key, int defaultValue)
      Gets a int system property value.
      static int intValue​(java.lang.String key, IntegerParser parser, int defaultValue)
      Gets a int system property value.
      static long longValue​(java.lang.Class<?> clazz, java.lang.String key)
      Gets a long system property value.
      static long longValue​(java.lang.Class<?> clazz, java.lang.String key, long defaultValue)
      Gets a long system property value.
      static long longValue​(java.lang.Class<?> clazz, java.lang.String key, LongParser parser, long defaultValue)
      Gets a long system property value.
      static long longValue​(java.lang.String key)
      Gets a long system property value.
      static long longValue​(java.lang.String key, long defaultValue)
      Gets a long system property value.
      static long longValue​(java.lang.String key, LongParser parser, long defaultValue)
      Gets a long system property value.
      static java.lang.String value​(java.lang.Class<?> clazz, java.lang.String key, java.lang.String defaultValue)
      Gets a system property value.
      static java.lang.String value​(java.lang.String key, java.lang.String defaultValue)
      Gets a system property value.
      • Methods inherited from class java.lang.Object

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

      • value

        public static java.lang.String value​(java.lang.String key,
                                             java.lang.String defaultValue)
        Gets a system property value.
        Parameters:
        key - the property key to get.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • value

        public static java.lang.String value​(java.lang.Class<?> clazz,
                                             java.lang.String key,
                                             java.lang.String defaultValue)
        Gets a system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • booleanValue

        public static boolean booleanValue​(java.lang.String key)
        Gets a boolean system property value.
        Parameters:
        key - the property key to retrieve.
        Returns:
        the property value or false if the property is not defined.
      • booleanValue

        public static boolean booleanValue​(java.lang.Class<?> clazz,
                                           java.lang.String key)
        Gets a boolean system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        Returns:
        the property value or false if the property is not defined.
      • booleanValue

        public static boolean booleanValue​(java.lang.String key,
                                           boolean defaultValue)
        Gets a boolean system property value.
        Parameters:
        key - the property key to retrieve.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • booleanValue

        public static boolean booleanValue​(java.lang.Class<?> clazz,
                                           java.lang.String key,
                                           boolean defaultValue)
        Gets a boolean system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the system property key (relative to the submitted Class) to get.
        defaultValue - The default value to return in case the property is not defined.
        Returns:
        The property value or the submitted default value if the property is not defined.
      • intValue

        public static int intValue​(java.lang.String key)
        Gets a int system property value.
        Parameters:
        key - the property key to retrieve.
        Returns:
        the property value or 0 if the property is not defined.
      • intValue

        public static int intValue​(java.lang.Class<?> clazz,
                                   java.lang.String key)
        Gets a int system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        Returns:
        the property value or 0 if the property is not defined.
      • intValue

        public static int intValue​(java.lang.String key,
                                   int defaultValue)
        Gets a int system property value.
        Parameters:
        key - the property key to retrieve.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • intValue

        public static int intValue​(java.lang.Class<?> clazz,
                                   java.lang.String key,
                                   int defaultValue)
        Gets a int system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • intValue

        public static int intValue​(java.lang.String key,
                                   IntegerParser parser,
                                   int defaultValue)
        Gets a int system property value.
        Parameters:
        key - the property key to retrieve.
        parser - the IntegerParser to use for property value parsing.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • intValue

        public static int intValue​(java.lang.Class<?> clazz,
                                   java.lang.String key,
                                   IntegerParser parser,
                                   int defaultValue)
        Gets a int system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        parser - the IntegerParser to use for property value parsing.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • longValue

        public static long longValue​(java.lang.String key)
        Gets a long system property value.
        Parameters:
        key - the property key to retrieve.
        Returns:
        the property value or 0 if the property is not defined.
      • longValue

        public static long longValue​(java.lang.Class<?> clazz,
                                     java.lang.String key)
        Gets a long system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        Returns:
        the property value or 0 if the property is not defined.
      • longValue

        public static long longValue​(java.lang.String key,
                                     long defaultValue)
        Gets a long system property value.
        Parameters:
        key - the property key to retrieve.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • longValue

        public static long longValue​(java.lang.Class<?> clazz,
                                     java.lang.String key,
                                     long defaultValue)
        Gets a long system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • longValue

        public static long longValue​(java.lang.String key,
                                     LongParser parser,
                                     long defaultValue)
        Gets a long system property value.
        Parameters:
        key - the property key to retrieve.
        parser - the LongParser to use for property value parsing.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.
      • longValue

        public static long longValue​(java.lang.Class<?> clazz,
                                     java.lang.String key,
                                     LongParser parser,
                                     long defaultValue)
        Gets a long system property value.
        Parameters:
        clazz - the Class to derive the property key from.
        key - the property key (relative to the submitted Class) to get.
        parser - the LongParser to use for property value parsing.
        defaultValue - the default value to return in case the property is not defined.
        Returns:
        the property value or the submitted default value if the property is not defined.