Class Modules


  • public class Modules
    extends Object
    This class contains useful methods for writing Step classes.
    Since:
    2.0
    Author:
    Laurent Jourdren
    • Method Detail

      • deprecatedParameter

        public static void deprecatedParameter​(StepConfigurationContext context,
                                               Parameter parameter)
        Show a message for deprecated parameters.
        Parameters:
        context - the step configuration context
        parameter - the deprecated parameter
      • deprecatedParameter

        public static void deprecatedParameter​(StepConfigurationContext context,
                                               Parameter parameter,
                                               boolean throwException)
                                        throws EoulsanException
        Show a message for deprecated parameters.
        Parameters:
        context - the step configuration context
        parameter - the deprecated parameter
        Throws:
        EoulsanException - throw an exception if required
      • deprecatedParameter

        public static void deprecatedParameter​(String stepId,
                                               Parameter parameter,
                                               boolean throwException)
                                        throws EoulsanException
        Show a message for deprecated parameters.
        Parameters:
        stepId - the step identifier
        parameter - the deprecated parameter
        Throws:
        EoulsanException - throw an exception if required
      • renamedParameter

        public static void renamedParameter​(StepConfigurationContext context,
                                            Parameter parameter,
                                            String newParameterName)
        Show a message for deprecated parameters that has been renamed. This method do not throw an exception.
        Parameters:
        context - the step configuration context
        parameter - the deprecated parameter
        newParameterName - the new parameter name
      • renamedParameter

        public static void renamedParameter​(StepConfigurationContext context,
                                            Parameter parameter,
                                            String newParameterName,
                                            boolean throwException)
                                     throws EoulsanException
        Show a message for deprecated parameters that has been renamed.
        Parameters:
        context - the step configuration context
        parameter - the deprecated parameter
        newParameterName - the new parameter name
        throwException - throw an exception
        Throws:
        EoulsanException - throw an exception if required
      • renamedParameter

        public static void renamedParameter​(String stepId,
                                            Parameter parameter,
                                            String newParameterName,
                                            boolean throwException)
                                     throws EoulsanException
        Show a message for deprecated parameters that has been renamed.
        Parameters:
        stepId - the step identifier
        parameter - the deprecated parameter
        newParameterName - the new parameter name
        throwException - throw an exception
        Throws:
        EoulsanException - throw an exception if required
      • removedParameter

        public static void removedParameter​(String stepId,
                                            Parameter parameter)
                                     throws EoulsanException
        Throw a exception for removed parameters.
        Parameters:
        stepId - the step identifier
        parameter - the deprecated parameter
        Throws:
        EoulsanException
      • unknownParameter

        public static void unknownParameter​(String stepId,
                                            Parameter parameter)
                                     throws EoulsanException
        Throw a exception for unknown parameters.
        Parameters:
        stepId - the step identifier
        parameter - the deprecated parameter
        Throws:
        EoulsanException
      • badParameterValue

        public static void badParameterValue​(String stepId,
                                             Parameter parameter,
                                             String message)
                                      throws EoulsanException
        Throw a exception for bad parameter value.
        Parameters:
        stepId - the step identifier
        parameter - the deprecated parameter
        message - error message
        Throws:
        EoulsanException
      • invalidConfiguration

        public static void invalidConfiguration​(String stepId,
                                                String message)
                                         throws EoulsanException
        Throw a exception for an invalid configuration.
        Parameters:
        stepId - the step identifier
        message - error message
        Throws:
        EoulsanException
      • getParameter

        public static Parameter getParameter​(Set<Parameter> parameters,
                                             String parameterName)
        Get the last parameter which name match for a parameter set.
        Parameters:
        parameters - the parameter set
        parameterName - the name of the parameter to look for
        Returns:
        the last parameter that match or null if the parameter is not found
      • containsParameter

        public static boolean containsParameter​(Set<Parameter> parameters,
                                                String parameterName)
        test if a set of parameters contains a parameter.
        Parameters:
        parameters - the parameter set
        parameterName - the name of the parameter to look for
        Returns:
        true if the set of parameter contains the parameter