Package com.vaadin.client.flow
Class ConstantPool
- java.lang.Object
-
- com.vaadin.client.flow.ConstantPool
-
public class ConstantPool extends Object
Map of constant values received from the server.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description ConstantPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
get(String key)
Gets the constant with a given key.boolean
has(String key)
Checks whether this constant pool contains a value for the given key.void
importFromJson(elemental.json.JsonObject json)
Imports new constants into this pool.
-
-
-
Method Detail
-
importFromJson
public void importFromJson(elemental.json.JsonObject json)
Imports new constants into this pool.- Parameters:
json
- a JSON object mapping constant keys to constant values, notnull
-
has
public boolean has(String key)
Checks whether this constant pool contains a value for the given key.- Parameters:
key
- the key to check, notnull
- Returns:
true
if there is a constant for the given key; otherwisefalse
-
get
public <T> T get(String key)
Gets the constant with a given key.- Type Parameters:
T
- the constant type- Parameters:
key
- the key to get a constant for, notnull
- Returns:
- the constant value, or
null
if there is no constant with the given key
-
-