Config.Builder

public static class Builder implements Config

Methods

addValue

public void addValue(String key, Object o)

Adds o to the collection at key.

Starts a new collection if the value doesn’t exists or the value isn’t currently a collection.

Parameters:
  • key – The location of the target collection
  • o – The value to add to the target collection

addValues

public void addValues(String key, Collection<Object> os)

Adds all values in o to the collection at key.

Starts a new collection if the value doesn’t exists or the value isn’t currently a collection.

Parameters:
  • key – The location of the target collection
  • os – The collection of values to add to the target collection

copy

public Config copy(boolean newVersionLine)

finalise

public ConfigUpdate finalise()

getValue

public <T> T getValue(String key, Class<T> type)

getValueOrDefault

public <T> T getValueOrDefault(String key, T defaultValue)

getValues

public <T> List<T> getValues(String key)

getValues

public <T> List<T> getValues(String key, Class<T> type)

modify

public Builder modify(UUID author)

readValue

public <T> Optional<T> readValue(String key)

readValue

public <T> Optional<T> readValue(String key, Class<T> type)

setValue

public void setValue(String key, Object o)

Sets the value at key to o.

Uses ValueOptions.DEFAULT.

Parameters:
  • key – The location of the target
  • o – The new value of the target

setValue

public void setValue(String key, Object o, ValueOptions opts)

Sets the value at key to o.

Parameters:
  • key – The location of the target
  • o – The new value of the target
  • opts – The options associated with the new value