Constructor and Description |
---|
Env()
Constructs an env instance with empty state.
|
Env(Map<String,Object> defaults)
Constructor.
|
Env(Map<String,Object> defaults,
Map<String,Object> overrides) |
Modifier and Type | Method and Description |
---|---|
String |
addPackageSymbol(String sym) |
String |
addSymbol(String sym) |
void |
clear()
Clear all override key-value pairs.
|
void |
configure(AviatorEvaluatorInstance instance,
Expression exp) |
boolean |
containsKey(Object key)
Check if a key has a defined value.
|
boolean |
containsValue(Object value)
Check if a value is present.
|
Set<Map.Entry<String,Object>> |
entrySet()
Get the set of entries.
|
Object |
forgot(Object key)
Remove a key-value pair from overrides.
|
Object |
get(Object key)
Get value for key.
|
Map<String,Object> |
getDefaults() |
Expression |
getExpression() |
List<String> |
getImportedSymbols() |
AviatorEvaluatorInstance |
getInstance() |
boolean |
isEmpty()
Check if no overrides are defined.
|
Set<String> |
keySet()
Get the set of keys.
|
Object |
override(String key,
Object value)
Set an override value.
|
Object |
put(String key,
Object value)
Assign an value, if it's already in overrides, it will update it, otherwise set it to default
map.
|
void |
putAll(Map map)
Add all key-value pairs from another map into the overrides map.
|
Object |
remove(Object key)
Remove a key-value pair.
|
Class<?> |
resolveClassSymbol(String name) |
Class<?> |
resolveClassSymbol(String name,
boolean checkIfAllow) |
void |
setExpression(Expression expression) |
void |
setInstance(AviatorEvaluatorInstance instance) |
void |
setmOverrides(Map<String,Object> mOverrides) |
int |
size()
Get the number of entries in the map.
|
String |
toString()
Gets the map as a String.
|
Collection<Object> |
values()
Get the values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public Env()
public Env(Map<String,Object> defaults)
defaults
- map providing defaults for keys not set directlypublic Expression getExpression()
public void setExpression(Expression expression)
public AviatorEvaluatorInstance getInstance()
public void setInstance(AviatorEvaluatorInstance instance)
public void configure(AviatorEvaluatorInstance instance, Expression exp)
public Class<?> resolveClassSymbol(String name) throws ClassNotFoundException
ClassNotFoundException
public Class<?> resolveClassSymbol(String name, boolean checkIfAllow) throws ClassNotFoundException
ClassNotFoundException
public void clear()
public boolean containsKey(Object key)
true
if the key is present in
the overrides map or the defaults map.containsKey
in interface Map<String,Object>
key
- true
if key defined, false
if notpublic boolean containsValue(Object value)
containsValue
in interface Map<String,Object>
value
- true
if value present as an override, false
if notpublic Object get(Object key)
public boolean isEmpty()
public Set<String> keySet()
public Object override(String key, Object value)
key
- value
- public Object put(String key, Object value)
public void putAll(Map map)
public Object remove(Object key)
public Object forgot(Object key)
key
- public int size()
public Collection<Object> values()
Copyright © 2010–2021. All rights reserved.