|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectninja.utils.NinjaPropertiesImpl
public class NinjaPropertiesImpl
Field Summary |
---|
Fields inherited from interface ninja.utils.NinjaProperties |
---|
CONF_FILE_LOCATION_BY_CONVENTION, NINJA_EXTERNAL_CONF |
Constructor Summary | |
---|---|
NinjaPropertiesImpl()
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public NinjaPropertiesImpl()
Method Detail |
---|
public String get(String key)
NinjaProperties
get
in interface NinjaProperties
public String getOrDie(String key)
NinjaProperties
getOrDie
in interface NinjaProperties
public Integer getInteger(String key)
NinjaProperties
getInteger
in interface NinjaProperties
public Integer getIntegerOrDie(String key)
NinjaProperties
getIntegerOrDie
in interface NinjaProperties
public Boolean getBooleanOrDie(String key)
NinjaProperties
getBooleanOrDie
in interface NinjaProperties
public Boolean getBoolean(String key)
getBoolean
in interface NinjaProperties
public void setProperty(String key, String value)
public void bindProperties(com.google.inject.Binder binder)
public boolean isProd()
NinjaProperties
isProd
in interface NinjaProperties
public boolean isDev()
NinjaProperties
isDev
in interface NinjaProperties
public boolean isTest()
NinjaProperties
isTest
in interface NinjaProperties
public Properties getAllCurrentNinjaProperties()
getAllCurrentNinjaProperties
in interface NinjaProperties
public String[] getStringArray(String key)
NinjaProperties
getStringArray
in interface NinjaProperties
public String getWithDefault(String key, String defaultValue)
NinjaProperties
getWithDefault
in interface NinjaProperties
key
- 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)
NinjaProperties
getIntegerWithDefault
in interface NinjaProperties
key
- 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)
NinjaProperties
getBooleanWithDefault
in interface NinjaProperties
key
- the key used in the configuration file.defaultValue
- Default value returned, when value cannot be found in configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |