Package com.vaadin.flow.internal
Class ConstantPool
- java.lang.Object
-
- com.vaadin.flow.internal.ConstantPool
-
- All Implemented Interfaces:
Serializable
public class ConstantPool extends Object implements Serializable
Keeps track ofConstantPoolKey
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConstantPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 timedumpConstants()
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:
dumpConstants()
-
hasNewConstants
public boolean hasNewConstants()
Checks if any new constants have been added to this constant pool since the last timedumpConstants()
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
-
-