public static class MetadataEnvironmentShell.Variables
extends java.lang.Object
Constructor and Description |
---|
Variables(MetadataEnvironmentShell.Variable<T> var,
T value)
Constructs a collection of one shell variable.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(MetadataEnvironmentShell.Variable var)
Returns
true if the given variable is in this collection. |
static MetadataEnvironmentShell.Variables |
copy(MetadataEnvironmentShell.Variables vars)
Returns the copy of a collection.
|
<T> T |
get(MetadataEnvironmentShell.Variable<T> var)
Returns the value of a variable.
|
static MetadataEnvironmentShell.Variables |
merge(MetadataEnvironmentShell.Variables global,
MetadataEnvironmentShell.Variables local)
Merges two sets of variables with the second set taking priority.
|
<T> void |
set(MetadataEnvironmentShell.Variable<T> var,
T value)
Sets the value of a variable.
|
java.lang.String |
toString() |
public Variables(MetadataEnvironmentShell.Variable<T> var, T value)
T
- the type of the variable valuevar
- the variablevalue
- the value of the variablepublic <T> T get(MetadataEnvironmentShell.Variable<T> var)
T
- the type of the variable valuevar
- the variable whose value is to be returnednull
if the value is null
or the variable is not in this collectionpublic <T> void set(MetadataEnvironmentShell.Variable<T> var, T value)
T
- the type of the variable valuevar
- the variable those value is to be set. If the variable
exists in this collection, its value will be replaced.value
- the value of the variablejava.lang.IllegalArgumentException
- if the given variable is null, or
if the value is null and the variable does not allow
null valuepublic boolean contains(MetadataEnvironmentShell.Variable var)
true
if the given variable is in this collection.var
- the variable to be checkedtrue
if the given variable is in this collectionpublic java.lang.String toString()
toString
in class java.lang.Object
public static MetadataEnvironmentShell.Variables copy(MetadataEnvironmentShell.Variables vars)
vars
- the collection to be copiednull
if the
given collection is nullpublic static MetadataEnvironmentShell.Variables merge(MetadataEnvironmentShell.Variables global, MetadataEnvironmentShell.Variables local)
global
- the global variables; may be nulllocal
- the local variables; may be null