java.lang.Object
fr.ens.biologie.genomique.eoulsan.core.Modules

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

    • 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
      throwException - if true, an exception will be thrown if the parameter is deprecated
      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
      throwException - if true, an exception will be thrown if the parameter is deprecated
      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(StepConfigurationContext context, Parameter parameter) throws EoulsanException
      Throw a exception for removed parameters.
      Parameters:
      context - the step configuration context
      parameter - the deprecated parameter
      Throws:
      EoulsanException - if the parameter has been removed
    • 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 - if the parameter has been removed
    • unknownParameter

      public static void unknownParameter(StepConfigurationContext context, Parameter parameter) throws EoulsanException
      Throw a exception for unknown parameters.
      Parameters:
      context - the step configuration context
      parameter - the deprecated parameter
      Throws:
      EoulsanException - if the parameter is unknown
    • 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 - if the parameter is unknown
    • badParameterValue

      public static void badParameterValue(StepConfigurationContext context, Parameter parameter, String message) throws EoulsanException
      Throw a exception for bad parameter value.
      Parameters:
      context - the step configuration context
      parameter - the deprecated parameter
      message - error message
      Throws:
      EoulsanException - if the parameter value is invalid
    • 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 - if the parameter value is invalid
    • invalidConfiguration

      public static void invalidConfiguration(StepConfigurationContext context, String message) throws EoulsanException
      Throw a exception for an invalid configuration.
      Parameters:
      context - the step configuration context
      message - error message
      Throws:
      EoulsanException - if the configuration is invalid
    • 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 - if the configuration is invalid
    • 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