Package org.supercsv.cellprocessor.time
Class FmtDuration
- java.lang.Object
-
- org.supercsv.cellprocessor.CellProcessorAdaptor
-
- org.supercsv.cellprocessor.time.FmtDuration
-
- All Implemented Interfaces:
CellProcessor
public class FmtDuration extends CellProcessorAdaptor
Converts a Duration to a String. For example, "PT1M12.345S" represents 1 minute, 12 seconds and 345 milliseconds.- Since:
- 2.4.0
-
-
Field Summary
-
Fields inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
next
-
-
Constructor Summary
Constructors Constructor Description FmtDuration()
Constructs a new FmtDuration processor, which formats a Duration as a String in the ISO 8601 duration format, in the same way asDuration.toString()
FmtDuration(CellProcessor next)
Constructs a new FmtDuration processor, which formats a Duration as a String, then calls the next processor in the chain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
execute(java.lang.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 org.supercsv.cellprocessor.CellProcessorAdaptor
toString, validateInputNotNull
-
-
-
-
Constructor Detail
-
FmtDuration
public FmtDuration()
Constructs a new FmtDuration processor, which formats a Duration as a String in the ISO 8601 duration format, in the same way asDuration.toString()
- See Also:
Duration.toString()
-
FmtDuration
public FmtDuration(CellProcessor next)
Constructs a new FmtDuration processor, which formats a Duration as a String, then calls the next processor in the chain.- Parameters:
next
- next processor in the chain- Throws:
java.lang.NullPointerException
- if next is null
-
-
Method Detail
-
execute
public java.lang.Object execute(java.lang.Object value, CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.- Parameters:
value
- the value to be processedcontext
- the CSV context- Returns:
- the result of cell processor execution
- Throws:
SuperCsvCellProcessorException
- if value is null or not a Duration
-
-