Class CheckpointFormatHelper
- java.lang.Object
-
- org.fugerit.java.core.util.checkpoint.CheckpointFormatHelper
-
- All Implemented Interfaces:
Serializable
,CheckpointFormat
public class CheckpointFormatHelper extends Object implements CheckpointFormat, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static CheckpointFormat
DEFAULT
static CheckpointFormat
DEFAULT_DECORATION
static StringFormat<Number>
FORMAT_DURATION_DEFAULT
static StringFormat<Number>
FORMAT_DURATION_NICE
static StringFormat<Number>
FORMAT_TIME_DEFAULT
static StringFormat<Number>
FORMAT_TIME_NICE
static String
TOKEN_END_DEF
static String
TOKEN_SEPARATOR_DEF
static String
TOKEN_START_DEF
-
Constructor Summary
Constructors Constructor Description CheckpointFormatHelper()
CheckpointFormatHelper(StringFormat<Number> formatTime, StringFormat<Number> formatDuration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
formatData(CheckpointData data)
void
formatDataHelperDefault(StringBuilder builder, CheckpointData data)
String
formatDuration(long duration)
String
formatTime(long time)
StringFormat<Number>
getFormatDuration()
StringFormat<Number>
getFormatTime()
static CheckpointFormat
newInstance(StringFormat<Number> formatTime, StringFormat<Number> formatDuration)
void
setFormatDuration(StringFormat<Number> formatDuration)
void
setFormatTime(StringFormat<Number> formatTime)
String
tokenEnd()
String
tokenSeparator()
String
tokenStart()
-
-
-
Field Detail
-
FORMAT_TIME_DEFAULT
public static final StringFormat<Number> FORMAT_TIME_DEFAULT
-
FORMAT_TIME_NICE
public static final StringFormat<Number> FORMAT_TIME_NICE
-
FORMAT_DURATION_DEFAULT
public static final StringFormat<Number> FORMAT_DURATION_DEFAULT
-
FORMAT_DURATION_NICE
public static final StringFormat<Number> FORMAT_DURATION_NICE
-
DEFAULT
public static final CheckpointFormat DEFAULT
-
DEFAULT_DECORATION
public static final CheckpointFormat DEFAULT_DECORATION
-
TOKEN_START_DEF
public static final String TOKEN_START_DEF
- See Also:
- Constant Field Values
-
TOKEN_END_DEF
public static final String TOKEN_END_DEF
- See Also:
- Constant Field Values
-
TOKEN_SEPARATOR_DEF
public static final String TOKEN_SEPARATOR_DEF
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CheckpointFormatHelper
public CheckpointFormatHelper()
-
CheckpointFormatHelper
public CheckpointFormatHelper(StringFormat<Number> formatTime, StringFormat<Number> formatDuration)
-
-
Method Detail
-
formatDataHelperDefault
public void formatDataHelperDefault(StringBuilder builder, CheckpointData data)
-
formatData
public String formatData(CheckpointData data)
- Specified by:
formatData
in interfaceCheckpointFormat
-
tokenStart
public String tokenStart()
- Specified by:
tokenStart
in interfaceCheckpointFormat
-
tokenEnd
public String tokenEnd()
- Specified by:
tokenEnd
in interfaceCheckpointFormat
-
tokenSeparator
public String tokenSeparator()
- Specified by:
tokenSeparator
in interfaceCheckpointFormat
-
getFormatTime
public StringFormat<Number> getFormatTime()
-
setFormatTime
public void setFormatTime(StringFormat<Number> formatTime)
-
getFormatDuration
public StringFormat<Number> getFormatDuration()
-
setFormatDuration
public void setFormatDuration(StringFormat<Number> formatDuration)
-
formatTime
public String formatTime(long time)
- Specified by:
formatTime
in interfaceCheckpointFormat
-
formatDuration
public String formatDuration(long duration)
- Specified by:
formatDuration
in interfaceCheckpointFormat
-
newInstance
public static CheckpointFormat newInstance(StringFormat<Number> formatTime, StringFormat<Number> formatDuration)
-
-