Class ConstantPool

java.lang.Object
com.vaadin.client.flow.ConstantPool

public class ConstantPool extends Object
Map of constant values received from the server.
Since:
1.0
Author:
Vaadin Ltd
  • Constructor Details

    • ConstantPool

      public ConstantPool()
  • Method Details

    • importFromJson

      public void importFromJson(elemental.json.JsonObject json)
      Imports new constants into this pool.
      Parameters:
      json - a JSON object mapping constant keys to constant values, not null
    • has

      public boolean has(String key)
      Checks whether this constant pool contains a value for the given key.
      Parameters:
      key - the key to check, not null
      Returns:
      true if there is a constant for the given key; otherwise false
    • get

      public <T> T get(String key)
      Gets the constant with a given key.
      Type Parameters:
      T - the constant type
      Parameters:
      key - the key to get a constant for, not null
      Returns:
      the constant value, or null if there is no constant with the given key