Package com.yahoo.vespa.config
Class ConfigPayloadBuilder
- java.lang.Object
-
- com.yahoo.vespa.config.ConfigPayloadBuilder
-
public class ConfigPayloadBuilder extends java.lang.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ConfigPayloadBuilder.Array
Representation of a config array, which supports both INDEX and APPEND modes.class
ConfigPayloadBuilder.MapBuilder
-
Constructor Summary
Constructors Constructor Description ConfigPayloadBuilder()
Construct a payload builder that is not a leaf.ConfigPayloadBuilder(ConfigDefinition configDefinition)
ConfigPayloadBuilder(ConfigPayload payload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigPayloadBuilder.Array
getArray(java.lang.String name)
Create a new array where new values may be added.ConfigDefinition
getConfigDefinition()
ConfigPayloadBuilder.MapBuilder
getMap(java.lang.String name)
Create a new map where new values may be added.ConfigPayloadBuilder
getObject(java.lang.String name)
Get a new payload builder for a config struct, which can be used to add inner values to that struct.java.lang.String
getValue()
Get the value of this field, if any.ConfigPayloadBuilder
override(ConfigPayloadBuilder other)
void
resolve(com.yahoo.slime.Cursor parent)
Create slime tree from this builder.void
setField(java.lang.String name, java.lang.String value)
Set the value of a config field.void
setValue(java.lang.String value)
-
-
-
Constructor Detail
-
ConfigPayloadBuilder
public ConfigPayloadBuilder()
Construct a payload builder that is not a leaf.
-
ConfigPayloadBuilder
public ConfigPayloadBuilder(ConfigDefinition configDefinition)
-
ConfigPayloadBuilder
public ConfigPayloadBuilder(ConfigPayload payload)
-
-
Method Detail
-
setField
public void setField(java.lang.String name, java.lang.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(java.lang.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(java.lang.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 java.lang.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(java.lang.String value)
-
getMap
public ConfigPayloadBuilder.MapBuilder getMap(java.lang.String name)
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()
-
-