public class ConstantPoolKey extends Object implements Serializable
ConstantPool
shared
between the client and the server. A constant pool key stored as a value in a
state node will be encoded as a string containing the id that the client can
use for fetching the actual JSON value from the client-side constant pool.
This is a way of deduplicating JSON values that are expected to be sent to
the same client multiple times, since all references to the same JSON
structure will be encoded as the same id.
For internal use only. May be renamed or removed in a future release.
Constructor and Description |
---|
ConstantPoolKey(elemental.json.JsonValue json)
Creates a new constant pool key for the given JSON value.
|
Modifier and Type | Method and Description |
---|---|
void |
export(elemental.json.JsonObject clientConstantPoolUpdate)
Exports this key into a JSON object to send to the client.
|
String |
getId()
Gets the id used to identify the referenced JSON constant.
|
public ConstantPoolKey(elemental.json.JsonValue json)
json
- the JSON constant, not null
public String getId()
public void export(elemental.json.JsonObject clientConstantPoolUpdate)
ConstantPool
instance that manages
this value. It may be called multiple times.clientConstantPoolUpdate
- the constant pool update that is to be sent to the client, not
null
Copyright © 2025. All rights reserved.