Class IGParameterConverter
java.lang.Object
fr.inria.rules.integraal.configuration.parameters.IGParameterConverter
Converts string-based external parameters into typed InteGraal parameters.
- Author:
- Pierre Bisquert, Michel Leclere
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IGParameter<InteGraalKeywords, ?> convert(IGParameter<String, String> parameter) Converts an "external" IGParameter (a tuple of String values) to an "internal" IGParameter (i.e. a tuple (InteGraalKeywords, Type)).static IGParameter<InteGraalKeywords, ?>[]convert(IGParameter<String, String>... parameters) 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.
-
Constructor Details
-
IGParameterConverter
public IGParameterConverter()Creates the parameter converter utility.
-
-
Method Details
-
convert
public static IGParameter<InteGraalKeywords, ?> convert(IGParameter<String, String> parameter) throws IGParameterExceptionConverts 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 theInteGraalKeywordsenumeration. The value must be one of the values associated with the type of this enum value (seeInteGraalKeywords).- 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 inInteGraalKeywords, 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 IGParameterExceptionConverts 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.
-