Class IGParameterConverter

java.lang.Object
fr.inria.rules.integraal.configuration.parameters.IGParameterConverter

public class IGParameterConverter extends Object
Converts string-based external parameters into typed InteGraal parameters.
Author:
Pierre Bisquert, Michel Leclere
  • Constructor Details

    • IGParameterConverter

      public IGParameterConverter()
      Creates the parameter converter utility.
  • Method Details

    • convert

      public static IGParameter<InteGraalKeywords, ?> convert(IGParameter<String,String> parameter) throws IGParameterException
      Converts an "external" IGParameter (a tuple of String values) to an "internal" IGParameter (i.e. a tuple (InteGraalKeywords, Type)).
      The conversion is based on the parameter's name and value. The name must match one of the values in the InteGraalKeywords enumeration. The value must be one of the values associated with the type of this enum value (see InteGraalKeywords).
      Parameters:
      parameter - The external IGParameter to be converted.
      Returns:
      An internal IGParameter with its associated InteGraalKeywords and the appropriate value type.
      Throws:
      IGParameterException - If the parameter name is unknown in InteGraalKeywords, or if the value format is incorrect wrt its expected type or if the type of the InteGraalKeyword is not specified.
    • convert

      @SafeVarargs public static IGParameter<InteGraalKeywords, ?>[] convert(IGParameter<String,String>... parameters) throws IGParameterException
      Converts multiple "external" IGParameters (tuples of String values) with String values to an array of "internal" IGParameters (i.e. tuples (InteGraalKeywords, Type)
      This method processes each parameter individually and converts it using the convert method.
      Parameters:
      parameters - The IGParameters with String values to be converted.
      Returns:
      An array of IGParameters with InteGraalKeywords and the appropriate value types.
      Throws:
      IGParameterException - If any parameter name is unknown, the value format is incorrect, or the type of the parameter is not specified.