Package com.tngtech.jgiven.format
Class DateFormatter
- java.lang.Object
-
- com.tngtech.jgiven.format.DateFormatter
-
- All Implemented Interfaces:
ArgumentFormatter<java.util.Date>
public class DateFormatter extends java.lang.Object implements ArgumentFormatter<java.util.Date>
General formatter to formatDate
values.This formatter simply delegates to a
SimpleDateFormat
.
- Since:
- 0.15.0
-
-
Constructor Summary
Constructors Constructor Description DateFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(java.util.Date date, java.lang.String... args)
ASimpleDateFormat
pattern is expected as first argument.
An optional second argument can be set to specify a locale as an ISO 639 language code.
-
-
-
Method Detail
-
format
public java.lang.String format(java.util.Date date, java.lang.String... args)
ASimpleDateFormat
pattern is expected as first argument.
An optional second argument can be set to specify a locale as an ISO 639 language code.- Specified by:
format
in interfaceArgumentFormatter<java.util.Date>
- Parameters:
date
- the object to formatargs
- optional arguments for the formatter to control the formatting.- Returns:
- a formatted string
-
-