Package org.jbehave.core.steps
Class ParameterConverters.EnumConverter
- java.lang.Object
-
- org.jbehave.core.steps.ParameterConverters.AbstractParameterConverter<String,T>
-
- org.jbehave.core.steps.ParameterConverters.FromStringParameterConverter<Enum<?>>
-
- org.jbehave.core.steps.ParameterConverters.EnumConverter
-
- All Implemented Interfaces:
ParameterConverters.ParameterConverter<String,Enum<?>>
- Direct Known Subclasses:
ParameterConverters.FluentEnumConverter
- Enclosing class:
- ParameterConverters
public static class ParameterConverters.EnumConverter extends ParameterConverters.FromStringParameterConverter<Enum<?>>
Parses value to anyEnum
-
-
Constructor Summary
Constructors Constructor Description EnumConverter()
-
Method Summary
Modifier and Type Method Description booleancanConvertTo(Type type)Returntrueif the converter can convert to the desired target type.Enum<?>convertValue(String value, Type type)Convert the value from one type to another, for example from abooleanto aString.-
Methods inherited from class org.jbehave.core.steps.ParameterConverters.AbstractParameterConverter
canConvertFrom, getSourceType, getTargetType
-
-
-
-
Method Detail
-
canConvertTo
public boolean canConvertTo(Type type)
Description copied from interface:ParameterConverters.ParameterConverterReturntrueif the converter can convert to the desired target type.- Specified by:
canConvertToin interfaceParameterConverters.ParameterConverter<String,Enum<?>>- Overrides:
canConvertToin classParameterConverters.AbstractParameterConverter<String,Enum<?>>- Parameters:
type- the type descriptor that describes the requested result type- Returns:
trueif that conversion can be performed
-
convertValue
public Enum<?> convertValue(String value, Type type)
Description copied from interface:ParameterConverters.ParameterConverterConvert the value from one type to another, for example from abooleanto aString.- Parameters:
value- the value to be convertedtype- the type descriptor that supplies extra information about the requested result type- Returns:
- the converted value
-
-