Class ConfigPayloadBuilder

java.lang.Object
com.yahoo.vespa.config.ConfigPayloadBuilder

public class ConfigPayloadBuilder extends Object
Helper class for building Slime config payloads, while supporting referring to payloads with their indices. The builder does not care about config field types. This is resolved by the actual config type consumer created from the Slime tree. TODO: Add toString
Author:
Ulf Lilleengen
  • Constructor Details

    • ConfigPayloadBuilder

      public ConfigPayloadBuilder()
      Construct a payload builder that is not a leaf.
    • ConfigPayloadBuilder

      public ConfigPayloadBuilder(ConfigDefinition configDefinition)
    • ConfigPayloadBuilder

      public ConfigPayloadBuilder(ConfigPayload payload)
  • Method Details

    • setField

      public void setField(String name, String value)
      Set the value of a config field.
      Parameters:
      name - Name of the config field.
      value - Value of the config field.
    • getObject

      public ConfigPayloadBuilder getObject(String name)
      Get a new payload builder for a config struct, which can be used to add inner values to that struct.
      Parameters:
      name - name of the struct to create
      Returns:
      a payload builder corresponding to the name
    • getArray

      public ConfigPayloadBuilder.Array getArray(String name)
      Create a new array where new values may be added.
      Parameters:
      name - Name of array.
      Returns:
      Array object supporting adding elements to it.
    • resolve

      public void resolve(com.yahoo.slime.Cursor parent)
      Create slime tree from this builder.
      Parameters:
      parent - the parent Cursor for this builder
    • override

      public ConfigPayloadBuilder override(ConfigPayloadBuilder other)
    • getValue

      public String getValue()
      Get the value of this field, if any.
      Returns:
      value of field, null if this is not a leaf.
    • setValue

      public void setValue(String value)
    • getMap

      Create a new map where new values may be added.
      Parameters:
      name - Name of map.
      Returns:
      Map builder supporting adding elements to it.
    • getConfigDefinition

      public ConfigDefinition getConfigDefinition()