Class ConvertedValues
ConverterStorage.
The ConvertedValues class encapsulates a map of key-value pairs representing converted values for a
specific identifier. Instances of this class are used to store and retrieve converted values in the converter
storage mechanism.
Usage example:
// Create an instance of ConvertedValues
ConvertedValues values = new ConvertedValues();
// Create an instance of ConvertedValues with initial values
Map<String, String> initialValues = Map.of("key1", "value1", "key2", "value2");
ConvertedValues valuesWithInitial = new ConvertedValues(initialValues);
Note: The keys and values in the map are assumed to be non-null.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofConvertedValueswith an empty map of values.ConvertedValues(ConvertedValues baseValues, ConvertedValues newValues) Creates a new instance ofConvertedValuesby merging two sets of values.ConvertedValues(Map<String, String> values) Creates a new instance ofConvertedValueswith the specified map of values. -
Method Summary
-
Constructor Details
-
ConvertedValues
public ConvertedValues()Creates a new instance ofConvertedValueswith an empty map of values. -
ConvertedValues
Creates a new instance ofConvertedValueswith the specified map of values.- Parameters:
values- the map of values to initialize the instance, cannot benull.
-
ConvertedValues
Creates a new instance ofConvertedValuesby merging two sets of values.This constructor merges the values from the provided
baseValuesandnewValuesinstances into a new map, which is then used to initialize theConvertedValuesinstance. The resulting map is copied to ensure immutability of theConvertedValuesinstance.- Parameters:
baseValues- the base set of values to include in the merge, cannot benull.newValues- the additional set of values to include in the merge, cannot benull.- Throws:
IllegalArgumentException- if either of the provided sets of values isnull.
-
-
Method Details
-
getValues
Returns an unmodifiable collection of values.This method returns an unmodifiable
mapof values stored in theConvertedValuesobject. This means that the calling code cannot modify the contents of this collection, but can access it for reading purposes.- Returns:
- an unmodifiable collection of values stored in the
ConvertedValuesobject. If there are no values, an empty collection is returned. This method never returnsnull.
-