Package com.vaadin.client.flow
Class ConstantPool
java.lang.Object
com.vaadin.client.flow.ConstantPool
Map of constant values received from the server.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TGets the constant with a given key.booleanChecks whether this constant pool contains a value for the given key.voidimportFromJson(elemental.json.JsonObject json) Imports new constants into this pool.
-
Constructor Details
-
ConstantPool
public ConstantPool()
-
-
Method Details
-
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
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
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
-