public enum SystemPropertyGetter extends Enum<SystemPropertyGetter> implements PropertyGetter
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
String |
getProperty(String propName)
Gets a property with a given name or a
null value, if the property is not found. |
String |
getProperty(String name,
String defaultValue)
Returns a property value.
|
static SystemPropertyGetter |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SystemPropertyGetter[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SystemPropertyGetter INSTANCE
public static SystemPropertyGetter[] values()
for (SystemPropertyGetter c : SystemPropertyGetter.values()) System.out.println(c);
public static SystemPropertyGetter valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getProperty(String name, String defaultValue)
System.getProperty(String)
,
if the system property does not exist
it looks at environment variables using System.getenv(String)
. If
the variable does not exist the method returns defautValue
.getProperty
in interface PropertyGetter
name
- Property namedefaultValue
- Default property valuedefaultValue
.public String getProperty(String propName)
PropertyGetter
null
value, if the property is not found.getProperty
in interface PropertyGetter
propName
- Property name.null
, if property is not found.Copyright © 2010–2017 PerfCake Community. All rights reserved.