public final class Environment
extends java.lang.Object
Environment for the client app. Contains a set of properties that
should be used for the client app configuration (eg. urls or flags). One client app should have
more than one Environment, and at least a production one.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ENVIRONMENT_PRODUCTION |
| Constructor and Description |
|---|
Environment() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
java.lang.String |
getName() |
<T> T |
getProperty(java.lang.String key,
T defaultValue)
Get the value of a property in this
Environment based on the key. |
int |
hashCode() |
boolean |
isProduction()
Returns
true if this is the production Environment. |
void |
setName(java.lang.String name) |
<T> void |
setProperty(java.lang.String key,
T value) |
java.lang.String |
toString() |
public static final java.lang.String ENVIRONMENT_PRODUCTION
public boolean isProduction()
true if this is the production Environment.true if this is the production Environment, false
otherwise.public <T> T getProperty(java.lang.String key,
T defaultValue)
throws java.lang.RuntimeException
Environment based on the key.key - the key of the desired property.defaultValue - the value that will be returned if the property is null or the key was
not found.null, the
key is not found or the type is not a valid JSON type the given defaultValue will be returned.java.lang.RuntimeExceptionpublic <T> void setProperty(java.lang.String key,
T value)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object