Class Duration

  • All Implemented Interfaces:

    public final class Duration
    extends java.lang.Object
    Immutable representation of a duration.
    Evren Sirin
    See Also:
    Serialized Form
    • Constructor Summary

      Constructor Description
      Duration​(long time)  
      Duration​(long time, java.util.concurrent.TimeUnit theUnit)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      long getMillis()  
      int hashCode()
      java.lang.String toString()
      String representation of duration
      long toUnit​(java.util.concurrent.TimeUnit theUnit)  
      static Duration valueOf​(java.lang.String str)
      Creates a duration instance from the string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Duration

        public Duration​(long time)
      • Duration

        public Duration​(long time,
                        java.util.concurrent.TimeUnit theUnit)
    • Method Detail

      • getMillis

        public long getMillis()
      • toUnit

        public long toUnit​(java.util.concurrent.TimeUnit theUnit)
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        String representation of duration
        toString in class java.lang.Object
      • valueOf

        public static Duration valueOf​(java.lang.String str)
        Creates a duration instance from the string.