Class DateFormatter

  • All Implemented Interfaces:
    ArgumentFormatter<java.util.Date>

    public class DateFormatter
    extends java.lang.Object
    implements ArgumentFormatter<java.util.Date>
    General formatter to format Date 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)
      A SimpleDateFormat pattern is expected as first argument.
      An optional second argument can be set to specify a locale as an ISO 639 language code.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateFormatter

        public DateFormatter()
    • Method Detail

      • format

        public java.lang.String format​(java.util.Date date,
                                       java.lang.String... args)
        A SimpleDateFormat 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 interface ArgumentFormatter<java.util.Date>
        Parameters:
        date - the object to format
        args - optional arguments for the formatter to control the formatting.
        Returns:
        a formatted string