Package com.complexible.common.base

# Class Duration

java.lang.Object
com.complexible.common.base.Duration

All Implemented Interfaces:
  `Serializable`

public final class Duration extends Object implements Serializable
Immutable representation of a duration.

Author:
  Evren Sirin
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Duration(long time)`
  `Duration(long time, TimeUnit theUnit)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `long`
  `getMillis()`
  `int`
  `hashCode()`
  `String`
  `toString()`
  String representation of duration
  `long`
  `toUnit(TimeUnit theUnit)`
  `static Duration`
  `valueOf(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 Details

  - ### Duration

    public Duration(long time)

  - ### Duration

    public Duration(long time, TimeUnit theUnit)

- ## Method Details

  - ### getMillis

    public long getMillis()

  - ### toUnit

    public long toUnit(TimeUnit theUnit)

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    String representation of duration
    Overrides:
      `toString` in class `Object`

  - ### valueOf

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