Package de.gebit.integrity.parameter.conversion

## Interface ValueConverter

- All Known Implementing Classes:
    `AbstractModularValueConverter`, `DefaultModularValueConverter`

      public interface ValueConverter

  The value converter is responsible for conversion of values during test execution and/or inside the Eclipse integration.
  Author:
    Rene Schneider - initial API and implementation

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Object` | `convertValue​(Class<?> aTargetType, Class<?> aParameterizedType, Object aValue, ConversionContext aConversionContext)` | Convert a given single Integrity or Java type value to a given target type (which is always a Java type).
    `Object` | `convertValue​(Class<?> aTargetType, Object aValue, ConversionContext aConversionContext)` | Convert a given single Integrity or Java type value to a given target type (which is always a Java type).
    `FormattedString` | `convertValueToFormattedString​(Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)` | Converts a given value to a formattedString.
    `FormattedString[]` | `convertValueToFormattedStringArray​(Object aValue, ConversionContext aConversionContext)` | Converts a given value to a formatted String array.
    `String` | `convertValueToString​(Object aValue, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)` | Converts a given value to a String.
    `String[]` | `convertValueToStringArray​(Object aValue, ConversionContext aConversionContext)` | Converts a given value to a String array.

- - ### Method Detail

    - #### convertValue

          Object convertValue​(Class<?> aTargetType,
                              Object aValue,
                              ConversionContext aConversionContext)
                       throws ParameterUtil.UnresolvableVariableException,
                              UnexecutableException

      Convert a given single Integrity or Java type value to a given target type (which is always a Java type).
      Parameters:
        `aTargetType` - the target type
        `aValue` - the value
        `aConversionContext` - controls some conversion parameters and rules; may be null if the default `ConversionContext` values shall be used
      Returns:
        the converted object
      Throws:
        `ParameterUtil.UnresolvableVariableException`
        `UnexecutableException`

    - #### convertValue

          Object convertValue​(Class<?> aTargetType,
                              Class<?> aParameterizedType,
                              Object aValue,
                              ConversionContext aConversionContext)
                       throws ParameterUtil.UnresolvableVariableException,
                              UnexecutableException

      Convert a given single Integrity or Java type value to a given target type (which is always a Java type).
      Parameters:
        `aTargetType` - the target type
        `aParameterizedType` - the parameterized (via generics) type attached to the given target type, if applicable - for example if a conversion to List is desired, the target type is List, and the parameterized type is Integer
        `aValue` - the value
        `aConversionContext` - controls some conversion parameters and rules; may be null if the default `ConversionContext` values shall be used
      Returns:
        the converted object
      Throws:
        `ParameterUtil.UnresolvableVariableException`
        `UnexecutableException`

    - #### convertValueToString

          String convertValueToString​(Object aValue,
                                      boolean aForceIntermediateMapFlag,
                                      ConversionContext aConversionContext)

      Converts a given value to a String. This method is intended to be used for the output of values (for example in test results, on the console etc). In comparison to `#convertValueToStringArray(Object, UnresolvableVariableHandling)`, this method always returns only a single String value, concatenating arrays first if necessary.
      Parameters:
        `aValue` - the value (can be an Integrity-internal type or a plain Java Object)
        `aForceIntermediateMapFlag` - whether the conversion should force the usage of an intermediate map (useful for bean types)
        `aConversionContext` - controls some conversion parameters and rules; may be null if the default `ConversionContext` values shall be used
      Returns:
        the string

    - #### convertValueToFormattedString

          FormattedString convertValueToFormattedString​(Object aValue,
                                                        boolean aForceIntermediateMapFlag,
                                                        ConversionContext aConversionContext)

      Converts a given value to a formattedString. This method is intended to be used for the output of values (for example in test results, on the console etc). In comparison to `#convertValueToStringArray(Object, UnresolvableVariableHandling)`, this method always returns only a single String value, concatenating arrays first if necessary.
      Parameters:
        `aValue` - the value (can be an Integrity-internal type or a plain Java Object)
        `aForceIntermediateMapFlag` - whether the conversion should force the usage of an intermediate map (useful for bean types)
        `aConversionContext` - controls some conversion parameters and rules; may be null if the default `ConversionContext` values shall be used
      Returns:
        the string

    - #### convertValueToStringArray

          String[] convertValueToStringArray​(Object aValue,
                                             ConversionContext aConversionContext)

      Converts a given value to a String array. This method is intended to be used for the output of values (for example in test results, on the console etc).
      Parameters:
        `aValue` - the value (can be an Integrity-internal type or a plain Java Object)
        `aConversionContext` - controls some conversion parameters and rules; may be null if the default `ConversionContext` values shall be used
      Returns:
        the string array

    - #### convertValueToFormattedStringArray

          FormattedString[] convertValueToFormattedStringArray​(Object aValue,
                                                               ConversionContext aConversionContext)

      Converts a given value to a formatted String array. This method is intended to be used for the output of values (for example in test results, on the console etc).
      Parameters:
        `aValue` - the value (can be an Integrity-internal type or a plain Java Object)
        `aConversionContext` - controls some conversion parameters and rules; may be null if the default `ConversionContext` values shall be used
      Returns:
        the string array