com.vaadin.flow.internal.
Class ConstantPool
- java.lang.Object
-
- com.vaadin.flow.internal.ConstantPool
-
All Implemented Interfaces:
public class ConstantPool extends Object implements Serializable
Keeps track of
ConstantPoolKey
values that have already been sent to the client.Since:
1.0
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor and Description ConstantPool()
-
Method Summary
All Methods Modifier and Type Method and Description elemental.json.JsonObject
dumpConstants()
Encodes all new constants to a JSON object and marks those constants as non-new.
String
getConstantId(ConstantPoolKey constant)
Gets the id of a given constant, registering the constant with this constant pool if it hasn't already been encountered.
boolean
hasNewConstants()
Checks if any new constants have been added to this constant pool since the last time
dumpConstants()
was called.
-
-
-
Method Detail
-
getConstantId
public String getConstantId(ConstantPoolKey constant)
Gets the id of a given constant, registering the constant with this constant pool if it hasn't already been encountered.
Parameters:
constant
- the constant reference to get an id for, notnull
Returns:
the constant id of the given constant, not
null
See Also:
-
hasNewConstants
public boolean hasNewConstants()
Checks if any new constants have been added to this constant pool since the last time
dumpConstants()
was called.Returns:
true
if there are new constants,false
otherwise
-
dumpConstants
public elemental.json.JsonObject dumpConstants()
Encodes all new constants to a JSON object and marks those constants as non-new.
Returns:
a JSON object describing all new constants
-
-