Class Durations

    • Constructor Summary

      Constructors 
      Constructor Description
      Durations()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Duration create​(long minutes)
      Create a Duration object from a number of minutes
      Duration decode​(java.lang.String duration)
      Convert the text to a Duration
      Example : decode("9d 10 h") -> Duration.encode("10d2h")
      java.lang.String encode​(Duration duration)
      Return the string value of the Duration.
      java.lang.String format​(Duration duration)
      Return the formatted work duration using the english bundles.
      • Methods inherited from class java.lang.Object

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

      • Durations

        public Durations()
    • Method Detail

      • create

        public Duration create​(long minutes)
        Create a Duration object from a number of minutes
      • decode

        public Duration decode​(java.lang.String duration)
        Convert the text to a Duration
        Example : decode("9d 10 h") -> Duration.encode("10d2h")
        Throws:
        java.lang.IllegalArgumentException
      • encode

        public java.lang.String encode​(Duration duration)
        Return the string value of the Duration.
        Example : encode(Duration.encode("9d 10h")) -> "10d2h"
      • format

        public java.lang.String format​(Duration duration)
        Return the formatted work duration using the english bundles.
        Example : format(Duration.encode("9d 10h")) -> 10d 2h