Class ParameterizedConstantPoolKey

java.lang.Object
com.vaadin.flow.internal.ParameterizedConstantPoolKey
All Implemented Interfaces:
Serializable

public class ParameterizedConstantPoolKey extends Object implements Serializable
A value that has two parts: a shared part, and a part that is specific to this instance.

The shared part is sent through the constant pool, so the client gets it only once. The instance specific part is sent as it is. Use this for values that are almost the same for all instances, with only a small part that changes. If the changing part were in the constant pool, every instance would add a new constant, and nothing would be shared.

The value is encoded as an array with two items:

  1. the constant pool id of the shared part, and
  2. the instance specific part.

For internal use only. May be renamed or removed in a future release.

Since:
25.4
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • ParameterizedConstantPoolKey

      public ParameterizedConstantPoolKey(ConstantPoolKey sharedValue, tools.jackson.databind.node.ObjectNode parameters)
      Creates a new parameterized constant pool key.
      Parameters:
      sharedValue - the shared value to send through the constant pool, not null
      parameters - the instance specific data to send as-is, not null
  • Method Details

    • encode

      public tools.jackson.databind.node.ArrayNode encode(ConstantPool constantPool)
      Encodes this value for the client. Adds the shared value to the given constant pool.
      Parameters:
      constantPool - the constant pool to use for the shared value, not null
      Returns:
      the encoded value