Interface IConfigKeyValueSerializer<T,K,V>
- Type Parameters:
T- entry typeK- key typeV- component value type
- All Superinterfaces:
IConfigValueSerializer<T>
Lets config editors treat a mod-specific value as separately editable key and value components.
This is useful for map-like entries in an ordered list, where changing the Java type to Map would lose entry
order or other domain data. Each component serializer defines its own editor and validation behavior; rebuilding an
unchanged entry must produce an equal value. Every accepted entry must have valid components, and
createEntry(Object, Object) must accept every component pair allowed by the component serializers.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateEntry(K key, V value) Create an entry from edited key and value components.Get the key from the entry.Get the serializer for the key.Get the component value from the entry.Get the serializer for the component value.Methods inherited from interface net.mezzdev.config.api.value.serializer.IConfigValueSerializer
deserialize, getAllValidValues, getRange, getValidValuesDescription, isValid, serialize
-
Method Details
-
getKeySerializer
IConfigValueSerializer<K> getKeySerializer()Get the serializer for the key.- Returns:
- key serializer
- Since:
- 0.1.0
-
getValueSerializer
IConfigValueSerializer<V> getValueSerializer()Get the serializer for the component value.- Returns:
- component value serializer
- Since:
- 0.1.0
-
getKey
Get the key from the entry.- Parameters:
entry- key-value entry- Returns:
- key component
- Since:
- 0.1.0
-
getValue
Get the component value from the entry.- Parameters:
entry- key-value entry- Returns:
- value component
- Since:
- 0.1.0
-
createEntry
Create an entry from edited key and value components. This must return without throwing when both components are accepted by their serializers.- Parameters:
key- key componentvalue- value component- Returns:
- key-value entry
- Since:
- 0.1.0
-