Class ConvertedValues

java.lang.Object
com.e1c.langtool.internal.converter.db.ConvertedValues

public final class ConvertedValues extends Object
Represents a set of converted values used by the 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 Details

    • ConvertedValues

      public ConvertedValues()
      Creates a new instance of ConvertedValues with an empty map of values.
    • ConvertedValues

      public ConvertedValues(Map<String,String> values)
      Creates a new instance of ConvertedValues with the specified map of values.
      Parameters:
      values - the map of values to initialize the instance, cannot be null.
    • ConvertedValues

      public ConvertedValues(ConvertedValues baseValues, ConvertedValues newValues)
      Creates a new instance of ConvertedValues by merging two sets of values.

      This constructor merges the values from the provided baseValues and newValues instances into a new map, which is then used to initialize the ConvertedValues instance. The resulting map is copied to ensure immutability of the ConvertedValues instance.

      Parameters:
      baseValues - the base set of values to include in the merge, cannot be null.
      newValues - the additional set of values to include in the merge, cannot be null.
      Throws:
      IllegalArgumentException - if either of the provided sets of values is null.
  • Method Details

    • getValues

      public Map<String,String> getValues()
      Returns an unmodifiable collection of values.

      This method returns an unmodifiable map of values stored in the ConvertedValues object. 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 ConvertedValues object. If there are no values, an empty collection is returned. This method never returns null.