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> Tget(String key)Gets the constant with a given key.booleanhas(String key)Checks whether this constant pool contains a value for the given key.voidimportFromJson(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:
trueif 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
nullif there is no constant with the given key
-
-