Class Durations

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Durations.DurationFormat
      Deprecated.
      since 6.3, only one format is available
    • Constructor Summary

      Constructors 
      Constructor Description
      Durations()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated 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​(java.util.Locale locale, Duration duration)
      Deprecated.
      since 6.3 as the Locale.ENGLISH is always used.
      java.lang.String format​(java.util.Locale locale, Duration duration, Durations.DurationFormat format)
      Deprecated.
      since 6.3 as the Locale.ENGLISH is always used.
      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

        @Deprecated
        public java.lang.String format​(java.util.Locale locale,
                                       Duration duration,
                                       Durations.DurationFormat format)
        Deprecated.
        since 6.3 as the Locale.ENGLISH is always used. Use format(Duration) instead
        Return the formatted work duration.
      • format

        @Deprecated
        public java.lang.String format​(java.util.Locale locale,
                                       Duration duration)
        Deprecated.
        since 6.3 as the Locale.ENGLISH is always used. Use format(Duration) instead
        Return the formatted work duration.
        Example : format(Locale.FRENCH, Duration.encode("9d 10h"), DurationFormat.SHORT) -> 10d 2d
      • 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