com.triactive.jdo.util
Class SystemProperty

java.lang.Object
  extended bycom.triactive.jdo.util.SystemProperty

public final class SystemProperty
extends java.lang.Object

Static methods for retrieving and system properties and converting them to various types.

These methods are very similar to others in java.lang; for example, intValue(java.lang.String, int) is nearly the same as Integer.getInteger(String,int). The main difference is that these methods log warnings for invalid property values.

Author:
Mike Martin

Method Summary
static boolean booleanValue(java.lang.String propName, boolean defaultValue)
          Returns the value of a system property as a boolean.
static int intValue(java.lang.String propName, int defaultValue)
          Returns the value of a system property as an integer.
static java.lang.String stringValue(java.lang.String propName, java.lang.String defaultValue)
          Returns the value of a system property as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

booleanValue

public static boolean booleanValue(java.lang.String propName,
                                   boolean defaultValue)
Returns the value of a system property as a boolean. If such a system property exists it is converted to a boolean with Boolean.valueOf(String). Returns the specified default value if no such system property exists or the property value is invalid.

Returns:
the boolean value of the specified property

intValue

public static int intValue(java.lang.String propName,
                           int defaultValue)
Returns the value of a system property as an integer. If such a system property exists it is converted to an integer with Integer.decode(String). Returns the specified default value if no such system property exists or the property value is invalid.

Returns:
the integer value of the specified property

stringValue

public static java.lang.String stringValue(java.lang.String propName,
                                           java.lang.String defaultValue)
Returns the value of a system property as a String. Returns the specified default value if no such system property exists.

Returns:
the String value of the specified property


Copyright © 2001-2007 The TJDO Project All Rights Reserved.