Package org.jbehave.core.steps
Class ParameterConverters.BooleanConverter
- java.lang.Object
-
- org.jbehave.core.steps.ParameterConverters.AbstractParameterConverter<String,T>
-
- org.jbehave.core.steps.ParameterConverters.FromStringParameterConverter<Boolean>
-
- org.jbehave.core.steps.ParameterConverters.BooleanConverter
-
- All Implemented Interfaces:
ParameterConverters.ParameterConverter<String,Boolean>
- Enclosing class:
- ParameterConverters
public static class ParameterConverters.BooleanConverter extends ParameterConverters.FromStringParameterConverter<Boolean>
-
-
Constructor Summary
Constructors Constructor Description BooleanConverter()
BooleanConverter(String trueValue, String falseValue)
-
Method Summary
Modifier and Type Method Description boolean
canConvertTo(Type type)
Returntrue
if the converter can convert to the desired target type.Boolean
convertValue(String value, Type type)
Convert the value from one type to another, for example from aboolean
to 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.ParameterConverter
Returntrue
if the converter can convert to the desired target type.- Specified by:
canConvertTo
in interfaceParameterConverters.ParameterConverter<String,Boolean>
- Overrides:
canConvertTo
in classParameterConverters.AbstractParameterConverter<String,Boolean>
- Parameters:
type
- the type descriptor that describes the requested result type- Returns:
true
if that conversion can be performed
-
convertValue
public Boolean convertValue(String value, Type type)
Description copied from interface:ParameterConverters.ParameterConverter
Convert the value from one type to another, for example from aboolean
to aString
.- Parameters:
value
- the value to be convertedtype
- the type descriptor that supplies extra information about the requested result type- Returns:
- the converted value
-
-