- java.lang.Object
-
- de.carne.util.SystemProperties
-
public final class SystemProperties extends java.lang.ObjectUtility class providing system properties related functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanbooleanValue(java.lang.Class<?> clazz, java.lang.String key)Gets abooleansystem property value.static booleanbooleanValue(java.lang.Class<?> clazz, java.lang.String key, boolean defaultValue)Gets abooleansystem property value.static booleanbooleanValue(java.lang.String key)Gets abooleansystem property value.static booleanbooleanValue(java.lang.String key, boolean defaultValue)Gets abooleansystem property value.static intintValue(java.lang.Class<?> clazz, java.lang.String key)Gets aintsystem property value.static intintValue(java.lang.Class<?> clazz, java.lang.String key, int defaultValue)Gets aintsystem property value.static intintValue(java.lang.Class<?> clazz, java.lang.String key, IntegerParser parser, int defaultValue)Gets aintsystem property value.static intintValue(java.lang.String key)Gets aintsystem property value.static intintValue(java.lang.String key, int defaultValue)Gets aintsystem property value.static intintValue(java.lang.String key, IntegerParser parser, int defaultValue)Gets aintsystem property value.static longlongValue(java.lang.Class<?> clazz, java.lang.String key)Gets alongsystem property value.static longlongValue(java.lang.Class<?> clazz, java.lang.String key, long defaultValue)Gets alongsystem property value.static longlongValue(java.lang.Class<?> clazz, java.lang.String key, LongParser parser, long defaultValue)Gets alongsystem property value.static longlongValue(java.lang.String key)Gets alongsystem property value.static longlongValue(java.lang.String key, long defaultValue)Gets alongsystem property value.static longlongValue(java.lang.String key, LongParser parser, long defaultValue)Gets alongsystem property value.static java.lang.Stringvalue(java.lang.Class<?> clazz, java.lang.String key, java.lang.String defaultValue)Gets a system property value.static java.lang.Stringvalue(java.lang.String key, java.lang.String defaultValue)Gets a system property value.
-
-
-
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 abooleansystem property value.- Parameters:
key- the property key to retrieve.- Returns:
- the property value or
falseif the property is not defined.
-
booleanValue
public static boolean booleanValue(java.lang.Class<?> clazz, java.lang.String key)Gets abooleansystem 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
falseif the property is not defined.
-
booleanValue
public static boolean booleanValue(java.lang.String key, boolean defaultValue)Gets abooleansystem 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 abooleansystem 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 aintsystem property value.- Parameters:
key- the property key to retrieve.- Returns:
- the property value or
0if the property is not defined.
-
intValue
public static int intValue(java.lang.Class<?> clazz, java.lang.String key)Gets aintsystem 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
0if the property is not defined.
-
intValue
public static int intValue(java.lang.String key, int defaultValue)Gets aintsystem 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 aintsystem 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 aintsystem 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 aintsystem 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 alongsystem property value.- Parameters:
key- the property key to retrieve.- Returns:
- the property value or
0if the property is not defined.
-
longValue
public static long longValue(java.lang.Class<?> clazz, java.lang.String key)Gets alongsystem 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
0if the property is not defined.
-
longValue
public static long longValue(java.lang.String key, long defaultValue)Gets alongsystem 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 alongsystem 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 alongsystem 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 alongsystem 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.
-
-