Package org.jboss.netty.util.internal
Class SystemPropertyUtil
- java.lang.Object
-
- org.jboss.netty.util.internal.SystemPropertyUtil
-
public final class SystemPropertyUtil extends java.lang.Object
A collection of utility methods to retrieve and parse the values of the Java system properties.
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
initializedLogger
private static java.util.regex.Pattern
INTEGER_PATTERN
private static boolean
loggedException
private static InternalLogger
logger
-
Constructor Summary
Constructors Modifier Constructor Description private
SystemPropertyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
contains(java.lang.String key)
Returnstrue
if and only if the system property with the specifiedkey
exists.static java.lang.String
get(java.lang.String key)
Returns the value of the Java system property with the specifiedkey
, while falling back tonull
if the property access fails.static java.lang.String
get(java.lang.String key, java.lang.String def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.static boolean
getBoolean(java.lang.String key, boolean def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.static int
getInt(java.lang.String key, int def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.static long
getLong(java.lang.String key, long def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.private static void
log(java.lang.String msg)
private static void
log(java.lang.String msg, java.lang.Exception e)
-
-
-
Field Detail
-
initializedLogger
private static boolean initializedLogger
-
logger
private static final InternalLogger logger
-
loggedException
private static boolean loggedException
-
INTEGER_PATTERN
private static final java.util.regex.Pattern INTEGER_PATTERN
-
-
Method Detail
-
contains
public static boolean contains(java.lang.String key)
Returnstrue
if and only if the system property with the specifiedkey
exists.
-
get
public static java.lang.String get(java.lang.String key)
Returns the value of the Java system property with the specifiedkey
, while falling back tonull
if the property access fails.- Returns:
- the property value or
null
-
get
public static java.lang.String get(java.lang.String key, java.lang.String def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
def
if there's no such property or if an access to the specified property is not allowed.
-
getBoolean
public static boolean getBoolean(java.lang.String key, boolean def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
def
if there's no such property or if an access to the specified property is not allowed.
-
getInt
public static int getInt(java.lang.String key, int def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
def
if there's no such property or if an access to the specified property is not allowed.
-
getLong
public static long getLong(java.lang.String key, long def)
Returns the value of the Java system property with the specifiedkey
, while falling back to the specified default value if the property access fails.- Returns:
- the property value.
def
if there's no such property or if an access to the specified property is not allowed.
-
log
private static void log(java.lang.String msg)
-
log
private static void log(java.lang.String msg, java.lang.Exception e)
-
-