Class FmtBool
java.lang.Object
org.supercsv.cellprocessor.CellProcessorAdaptor
org.supercsv.cellprocessor.FmtBool
- All Implemented Interfaces:
BoolCellProcessor, CellProcessor
Converts a Boolean into a formatted string. If you want to convert from a String to a Boolean, use the
ParseBool processor.- Since:
- 1.50
-
Field Summary
FieldsFields inherited from class CellProcessorAdaptor
next -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new FmtBool processor, which converts a Boolean into a formatted string.FmtBool(String trueValue, String falseValue, StringCellProcessor next) Constructs a new FmtBool processor, which converts a Boolean into a formatted string, then calls the next processor in the chain. -
Method Summary
Modifier and TypeMethodDescriptionexecute(Object value, CsvContext context) This method is invoked by the framework when the processor needs to process data or check constraints.Methods inherited from class CellProcessorAdaptor
toString, validateInputNotNull
-
Field Details
-
trueValue
-
falseValue
-
-
Constructor Details
-
FmtBool
-
FmtBool
Constructs a new FmtBool processor, which converts a Boolean into a formatted string, then calls the next processor in the chain.- Parameters:
trueValue- the String to use if the value is truefalseValue- the String to use if the value is falsenext- the next processor in the chain- Throws:
NullPointerException- if next is null
-
-
Method Details
-
execute
This method is invoked by the framework when the processor needs to process data or check constraints.- Specified by:
executein interfaceCellProcessor- Parameters:
value- the value to be processedcontext- the CSV context- Returns:
- the result of cell processor execution
- Throws:
SuperCsvCellProcessorException- if value is null or is not a Boolean
-