Package io.cucumber.cucumberexpressions
Class ParameterType<T>
java.lang.Object
io.cucumber.cucumberexpressions.ParameterType<T>
- All Implemented Interfaces:
Comparable<ParameterType<?>>
@API(status=STABLE)
public final class ParameterType<T>
extends Object
implements Comparable<ParameterType<?>>
-
Constructor Summary
ConstructorsConstructorDescriptionParameterType(String name, String regexp, Class<T> type, CaptureGroupTransformer<T> transformer) ParameterType(String name, String regexp, Class<T> type, CaptureGroupTransformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch) ParameterType(String name, String regexp, Class<T> type, Transformer<T> transformer) ParameterType(String name, String regexp, Class<T> type, Transformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch) ParameterType(String name, String regexp, Class<T> type, Transformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch, boolean useRegexpMatchAsStrongTypeHint) ParameterType(String name, List<String> regexps, Class<T> type, CaptureGroupTransformer<T> transformer) ParameterType(String name, List<String> regexps, Class<T> type, CaptureGroupTransformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch) ParameterType(String name, List<String> regexps, Class<T> type, Transformer<T> transformer) ParameterType(String name, List<String> regexps, Class<T> type, Transformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch) ParameterType(String name, List<String> regexps, Class<T> type, Transformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch, boolean useRegexpMatchAsStrongTypeHint) ParameterType(String name, List<String> regexps, Type type, CaptureGroupTransformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch) ParameterType(String name, List<String> regexps, Type type, CaptureGroupTransformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch, boolean useRegexpMatchAsStrongTypeHint) ParameterType(String name, List<String> regexps, Type type, Transformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch) ParameterType(String name, List<String> regexps, Type type, Transformer<T> transformer, boolean useForSnippets, boolean preferForRegexpMatch, boolean useRegexpMatchAsStrongTypeHint) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ParameterType<?> o) getName()This is used in the type name in typed expressionsgetType()Returns the type of the parameter type - typically the type the transform transforms to.booleanIndicates whether or not this is a preferential parameter type when matching text against aRegularExpression.booleanIndicates whether or not this is a parameter type should be used for generatingGeneratedExpressions from text.booleanIndicates whether or not this parameter provides a strong type hint when considering a regular expression match.intweight()
-
Constructor Details
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
ParameterType
-
-
Method Details
-
getName
This is used in the type name in typed expressions- Returns:
- human readable type name
-
getType
Returns the type of the parameter type - typically the type the transform transforms to. This can be used in conjunction with GeneratedExpression (snippets) to generate snippets for statically typed languages. Not used for anything else.- Returns:
- the type of the parameter type
-
getRegexps
-
preferForRegexpMatch
public boolean preferForRegexpMatch()Indicates whether or not this is a preferential parameter type when matching text against aRegularExpression. In case there are multiple parameter types with a regexp identical to the capture group's regexp, a preferential parameter type will win. If there are more than 1 preferential ones, an error will be thrown.- Returns:
- true if this is a preferential type
-
useForSnippets
public boolean useForSnippets()Indicates whether or not this is a parameter type should be used for generatingGeneratedExpressions from text. Typically, parameter types with greedy regexps should return false.- Returns:
- true is this parameter type is used for expression generation
-
useRegexpMatchAsStrongTypeHint
public boolean useRegexpMatchAsStrongTypeHint()Indicates whether or not this parameter provides a strong type hint when considering a regular expression match. If so, the type hint provided by the method arguments will be ignored. If not, when both type hints are in agreement, this parameter types transformer will be used. Otherwise parameter transformation for a regular expression match will be handled byParameterTypeRegistry.getDefaultParameterTransformer().- Returns:
- true if this parameter type provides a type hint when considering a regular expression match
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-
weight
public int weight()
-