@Vetoed public class DefaultEnvironment extends Object implements Environment
Environment
based on EnvironmentType
.Modifier | Constructor and Description |
---|---|
protected |
DefaultEnvironment()
Deprecated.
CDI eyes only
|
|
DefaultEnvironment(EnvironmentType environmentType) |
Modifier and Type | Method and Description |
---|---|
String |
get(String key)
Returns a key
|
String |
get(String key,
String defaultValue)
Returns a key or a default value if the value isn't set
|
Iterable<String> |
getKeys() |
String |
getName()
Returns the environment name
|
URL |
getResource(String name)
Locates a resource according to your current environment.
|
boolean |
has(String key)
Checks if a key is present
|
boolean |
isDevelopment()
An alias to
Environment.supports(String) with EnvironmentType.DEVELOPMENT . |
boolean |
isProduction()
An alias to
Environment.supports(String) with EnvironmentType.PRODUCTION . |
boolean |
isTest()
An alias to
Environment.supports(String) with EnvironmentType.TEST . |
void |
set(String key,
String value)
Sets a key in memory.
|
boolean |
supports(String feature)
Checks if a key is equals to true if it's not present will return false
|
protected DefaultEnvironment() throws IOException
IOException
public DefaultEnvironment(EnvironmentType environmentType) throws IOException
IOException
public boolean supports(String feature)
Environment
supports
in interface Environment
public boolean has(String key)
Environment
has
in interface Environment
public String get(String key)
Environment
get
in interface Environment
public String get(String key, String defaultValue)
Environment
get
in interface Environment
public void set(String key, String value)
Environment
set
in interface Environment
public Iterable<String> getKeys()
getKeys
in interface Environment
Iterable
with all keyspublic boolean isProduction()
Environment
Environment.supports(String)
with EnvironmentType.PRODUCTION
.isProduction
in interface Environment
public boolean isDevelopment()
Environment
Environment.supports(String)
with EnvironmentType.DEVELOPMENT
.isDevelopment
in interface Environment
public boolean isTest()
Environment
Environment.supports(String)
with EnvironmentType.TEST
.isTest
in interface Environment
public URL getResource(String name)
Environment
getResource
in interface Environment
public String getName()
Environment
getName
in interface Environment
Copyright © 2014 Caelum. All rights reserved.