Interface Parameters

  • All Superinterfaces:
    Row
    All Known Implementing Classes:
    ConvertedParameters

    public interface Parameters
    extends Row
    Provides parameter values as given types
    • Method Summary

      Modifier and Type Method Description
      <T> T mapTo​(Class<T> type)
      Maps parameters to the specified type
      <T> T mapTo​(Class<T> type, Map<String,​String> fieldNameMapping)
      Maps parameters to the specified type
      <T> T valueAs​(String name, Type type)
      Returns the value of a named parameter as a given type
      <T> T valueAs​(String name, Type type, T defaultValue)
      Returns the value of a named parameter as a given type while providing a default value if the name is not found
      • Methods inherited from interface org.jbehave.core.steps.Row

        values
    • Method Detail

      • valueAs

        <T> T valueAs​(String name,
                      Type type)
        Returns the value of a named parameter as a given type
        Parameters:
        type - the Type or Class of type <T> to convert to
        name - the name of the parameter
        Returns:
        The value of type <T>
      • valueAs

        <T> T valueAs​(String name,
                      Type type,
                      T defaultValue)
        Returns the value of a named parameter as a given type while providing a default value if the name is not found
        Parameters:
        type - Type or Class of type <T> to convert to
        name - the name of the parameter
        defaultValue - the default value if the name is not found
        Returns:
        The value of type <T>
      • mapTo

        <T> T mapTo​(Class<T> type)
        Maps parameters to the specified type
        Parameters:
        type - The target type
        Returns:
        The object of type <T>
      • mapTo

        <T> T mapTo​(Class<T> type,
                    Map<String,​String> fieldNameMapping)
        Maps parameters to the specified type
        Parameters:
        type - The target type
        fieldNameMapping - The field mapping between parameters and target type fields
        Returns:
        The object of type <T>