public class ConfigurationDataImpl extends Object implements ConfigurationData
| Modifier | Constructor and Description |
|---|---|
protected |
ConfigurationDataImpl(@NotNull List<? extends Property<?>> allProperties,
@NotNull Map<String,List<String>> allComments)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areAllValuesValidInResource()
Returns if the last call of
ConfigurationData.initializeValues(ch.jalu.configme.resource.PropertyReader) had fully valid values in the resource
for all known properties. |
@NotNull Map<String,List<String>> |
getAllComments()
Returns all comments registered to this configuration data.
|
@NotNull List<String> |
getCommentsForSection(String path)
Returns the comments associated with the given path.
|
@NotNull List<Property<?>> |
getProperties()
Returns all known properties.
|
<T> T |
getValue(@NotNull Property<T> property)
Returns the value associated with the given property.
|
protected @NotNull Map<String,Object> |
getValues() |
void |
initializeValues(@NotNull PropertyReader reader)
Initializes the values of all
known properties based on the provided reader. |
<T> void |
setValue(@NotNull Property<T> property,
T value)
Sets the given value for the given property.
|
protected <T> boolean |
setValueForProperty(@NotNull Property<T> property,
@NotNull PropertyReader reader) |
protected ConfigurationDataImpl(@NotNull
@NotNull List<? extends Property<?>> allProperties,
@NotNull
@NotNull Map<String,List<String>> allComments)
ConfigurationDataBuilder.allProperties - all known propertiesallComments - map of comments by path@NotNull public @NotNull List<Property<?>> getProperties()
ConfigurationDataPropertyListBuilder
for more details).getProperties in interface ConfigurationData@NotNull public @NotNull List<String> getCommentsForSection(String path)
ConfigurationDatagetCommentsForSection in interface ConfigurationDatapath - the path for which the comments should be retrieved@NotNull public @NotNull Map<String,List<String>> getAllComments()
ConfigurationDataConfigurationData.getCommentsForSection(String) if you are not interested
in the entirety of the comments.getAllComments in interface ConfigurationData@NotNull
public <T> T getValue(@NotNull
@NotNull Property<T> property)
ConfigurationDataConfigurationData.getProperties(). Throws an exception if the property is unknown.getValue in interface ConfigurationDataT - property typeproperty - the property to look uppublic <T> void setValue(@NotNull
@NotNull Property<T> property,
@NotNull
T value)
ConfigurationDatasetValue in interface ConfigurationDataT - the property typeproperty - the property to change the value forvalue - the value to setpublic void initializeValues(@NotNull
@NotNull PropertyReader reader)
ConfigurationDataknown properties based on the provided reader.
Clears any already existing values.initializeValues in interface ConfigurationDatareader - the reader to use to determine the property's valuesprotected <T> boolean setValueForProperty(@NotNull
@NotNull Property<T> property,
@NotNull
@NotNull PropertyReader reader)
public boolean areAllValuesValidInResource()
ConfigurationDataConfigurationData.initializeValues(ch.jalu.configme.resource.PropertyReader) had fully valid values in the resource
for all known properties. If false, at least one property was either not present in the resource, or the data
under its path was not fully acceptable for the property type. Returns false if the properties have not yet
been loaded.areAllValuesValidInResource in interface ConfigurationDataPropertyValue.isValidInResource()Copyright © 2016–2023 The AuthMe Team. All rights reserved.