public class NinjaPropertiesImpl extends Object implements NinjaProperties
CONF_FILE_LOCATION_BY_CONVENTION, NINJA_EXTERNAL_CONF| Constructor and Description |
|---|
NinjaPropertiesImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
bindProperties(com.google.inject.Binder binder) |
String |
get(String key)
Get a String property or null if it is not there...
|
Properties |
getAllCurrentNinjaProperties() |
Boolean |
getBoolean(String key) |
Boolean |
getBooleanOrDie(String key)
The "die" method forces this key to be set.
|
Boolean |
getBooleanWithDefault(String key,
Boolean defaultValue)
Get a Boolean property or a default value when property cannot be found
in any configuration file.
|
Integer |
getInteger(String key)
Get a property as Integer of null if not there / or property no integer
|
Integer |
getIntegerOrDie(String key)
The "die" method forces this key to be set.
|
Integer |
getIntegerWithDefault(String key,
Integer defaultValue)
Get a Integer property or a default value when property cannot be found
in any configuration file.
|
String |
getOrDie(String key)
The "die" method forces this key to be set.
|
String[] |
getStringArray(String key)
eg.
|
String |
getWithDefault(String key,
String defaultValue)
Get a String property or a default value when property cannot be found in
any configuration file.
|
boolean |
isDev()
Whether we are in dev mode
|
boolean |
isProd()
Whether we are in prod mode
|
boolean |
isTest()
Whether we are in test mode
|
void |
setProperty(String key,
String value) |
public String get(String key)
NinjaPropertiesget in interface NinjaPropertiespublic String getOrDie(String key)
NinjaPropertiesgetOrDie in interface NinjaPropertiespublic Integer getInteger(String key)
NinjaPropertiesgetInteger in interface NinjaPropertiespublic Integer getIntegerOrDie(String key)
NinjaPropertiesgetIntegerOrDie in interface NinjaPropertiespublic Boolean getBooleanOrDie(String key)
NinjaPropertiesgetBooleanOrDie in interface NinjaPropertiespublic Boolean getBoolean(String key)
getBoolean in interface NinjaPropertiespublic void bindProperties(com.google.inject.Binder binder)
public boolean isProd()
NinjaPropertiesisProd in interface NinjaPropertiespublic boolean isDev()
NinjaPropertiesisDev in interface NinjaPropertiespublic boolean isTest()
NinjaPropertiesisTest in interface NinjaPropertiespublic Properties getAllCurrentNinjaProperties()
getAllCurrentNinjaProperties in interface NinjaPropertiespublic String[] getStringArray(String key)
NinjaPropertiesgetStringArray in interface NinjaPropertiespublic String getWithDefault(String key, String defaultValue)
NinjaPropertiesgetWithDefault in interface NinjaPropertieskey - the key used in the configuration file.defaultValue - Default value returned, when value cannot be found in
configuration.public Integer getIntegerWithDefault(String key, Integer defaultValue)
NinjaPropertiesgetIntegerWithDefault in interface NinjaPropertieskey - the key used in the configuration file.defaultValue - Default value returned, when value cannot be found in
configuration.public Boolean getBooleanWithDefault(String key, Boolean defaultValue)
NinjaPropertiesgetBooleanWithDefault in interface NinjaPropertieskey - the key used in the configuration file.defaultValue - Default value returned, when value cannot be found in
configuration.Copyright © 2013. All Rights Reserved.