Interface IConfigListValueSerializer<T>
- All Superinterfaces:
IConfigValueSerializer<List<T>>
Built-in list helpers already provide this metadata. Implement it for custom list validation or when declaring a list
through IConfigCategoryBuilder.addValue(String, Object, IConfigValueSerializer). Element serializers may also
implement IConfigKeyValueSerializer to present entries as editable key-value rows.
MezzConfig stores the list element-by-element with getElementSerializer(); the inherited container-level text
representation is not used for structured file storage. Returned list values are unmodifiable snapshots, and their
elements must follow the immutable value contract.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the serializer config editors should use for individual elements.default ConfigListOrderingTell config editors whether reordering entries changes the setting's meaning.Get the value class independently of current values, defaults, and collection contents.Methods inherited from interface net.mezzdev.config.api.value.serializer.IConfigValueSerializer
deserialize, getAllValidValues, getRange, getValidValuesDescription, isValid, serialize
-
Method Details
-
getValueClass
Get the value class independently of current values, defaults, and collection contents.The declared class must remain constant and accept every value supported by this serializer. Use boxed classes for primitive values. Describe the Java value, even when its serialized text resembles another type.
A list's class describes only the container because Java erases element types. Use
getElementSerializer()to inspect the element class and validation.- Specified by:
getValueClassin interfaceIConfigValueSerializer<T>- Returns:
- the non-null value class
- Since:
- 0.7.0
-
getOrdering
Tell config editors whether reordering entries changes the setting's meaning.MezzConfig preserves the physical order in the config file either way. Integrations can use this metadata to decide whether reordering controls are useful.
- Returns:
- ordering semantics for this list
- Since:
- 0.1.0
-
getElementSerializer
IConfigValueSerializer<T> getElementSerializer()Get the serializer config editors should use for individual elements.- Since:
- 0.1.0
-