public class SettingsListBuilder extends Object
ISettingsList
.
Here are some examples :
// Get a new empty settings list
ISettingsList list = new SettingsListBuilder().build();
// Get a new filled list
ISettingsList list = new SettingsListBuilder().add(1).add(2).add(3).build()
// Get a list from the content of a string
ISettingsList list = new SettingsListBuilder().fromString("[1,2,3]").build()
Constructor and Description |
---|
SettingsListBuilder()
get a new
SettingsListBuilder , ths is the only official way to
create from scratch a settings map. |
Modifier and Type | Method and Description |
---|---|
SettingsListBuilder |
add(Object value)
Before getting your list, fill in some values.
|
SettingsListBuilder |
addAll(Collection<?> c)
Add an initial collection to the content of your list
|
ISettingsList |
build()
Build and get your
ISettingsList . |
SettingsListBuilder |
fromFile(File file) |
SettingsListBuilder |
fromFile(Path path) |
SettingsListBuilder |
fromString(String content)
load your list from a string content
|
SettingsListBuilder |
setOriginatorName(String name)
Associate a name to you setting list.
|
public SettingsListBuilder()
SettingsListBuilder
, ths is the only official way to
create from scratch a settings map.public SettingsListBuilder setOriginatorName(String name)
name
- an arbitrary namepublic SettingsListBuilder add(Object value)
value
- the property valuepublic ISettingsList build()
ISettingsList
.public SettingsListBuilder fromString(String content) throws SettingsException
content
- a string conatining a json listSettingsException
public SettingsListBuilder fromFile(File file) throws IOException, ConfigurationException
IOException
ConfigurationException
public SettingsListBuilder fromFile(Path path) throws ConfigurationException
ConfigurationException
public SettingsListBuilder addAll(Collection<?> c)
c
- the collection to addCopyright © 2014–2022. All rights reserved.