public final class Environment extends Object
| Constructor and Description |
|---|
Environment()
Initialize the enviroment with all relevant system environment entries.
|
Environment(boolean ignoreEnvironment)
Constructor that ignores the system environment,
mostly used to enable repeatable tests.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
debug() |
Set<Map.Entry<String,String>> |
entrySet()
Return a set of all the entries, just like a Map does.
|
String |
get(String name)
Get the named environment entry.
|
boolean |
getBooleanOption(String name)
Return the value of the environment entry corresponding
to the named option.
|
File |
getDebugLogfile() |
static String |
getDebugVar()
Get the name of the environment variable used to set debugging on
|
static String |
getPrefix()
Get the prefix for environment variables referenced from the system
environment by Environment objects.
|
String |
getStringOption(String name)
Return the value of the environment entry corresponding
to the named option.
|
boolean |
hasOption(String name)
Is there an environment entry corresponding to the named option?
|
String |
put(String name,
String value)
Set the named environment entry to the specified value.
|
String |
putOption(String name,
String value)
Set the environment entry corresponding to the named option
to the specified value.
|
void |
remove(String name)
Remove the name environment entry.
|
static void |
setPrefix(String p)
Set the prefix for environment variables referenced from the system
environment by Environment objects.
|
static void |
setShortPrefix(String p)
Set the short prefix for environment variables referenced from the system
enviornment by Environment objects.
|
boolean |
trace() |
public Environment()
public Environment(boolean ignoreEnvironment)
public static void setPrefix(String p)
p - the new prefixpublic static String getPrefix()
public static void setShortPrefix(String p)
public static String getDebugVar()
public boolean getBooleanOption(String name)
name - the option namepublic String getStringOption(String name)
name - the option namepublic boolean hasOption(String name)
name - the option namepublic String get(String name)
name - the name of the environment entrypublic String put(String name, String value)
name - the environment entry namevalue - the valuepublic void remove(String name)
name - the environment entry namepublic String putOption(String name, String value)
name - the option namevalue - the valuepublic Set<Map.Entry<String,String>> entrySet()
public boolean debug()
public boolean trace()
public File getDebugLogfile()
Copyright © 2019. All rights reserved.