com.vaadin.flow.internal.
Class ConstantPool
All Implemented Interfaces:
Keeps track of ConstantPoolKey
values that have already been sent to
the client.
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionelemental.json.JsonObject
Encodes all new constants to a JSON object and marks those constants as non-new.
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
Checks if any new constants have been added to this constant pool since the last time
dumpConstants()
was called.
-
Constructor Details
-
ConstantPool
public ConstantPool()
-
-
Method Details
-
getConstantId
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
-