Package: java.time

## [Java] Class Duration

- java.time.Duration

-     public class Duration
      extends Object

  GDK enhancements for Duration.

  displayName:
    Duration
  receiverFqcn:
    java.time.Duration

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Duration` | `div(long scalar)` Supports the division operator; equivalent to calling the Duration.dividedBy method.
    `` | `public boolean` | `isNonnegative()` Returns true if this duration is zero or positive.
    `` | `public boolean` | `isNonpositive()` Returns true if this duration is zero or negative.
    `` | `public boolean` | `isPositive()` Returns true if this duration is positive, excluding zero.
    `` | `public Duration` | `minus(long seconds)` Returns a Duration that is `seconds` seconds shorter that this duration.
    `` | `public Duration` | `multiply(long scalar)` Supports the multiplication operator; equivalent to calling the Duration.multipliedBy method.
    `` | `public Duration` | `negative()` Supports the unary minus operator; equivalent to calling the Duration.negated method.
    `` | `public Duration` | `next()` Returns a Duration that is one second longer than this duration.
    `` | `public Duration` | `plus(long seconds)` Returns a Duration that is `seconds` seconds longer than this duration.
    `` | `public Duration` | `positive()` Supports the unary plus operator; equivalent to calling the Duration.abs method.
    `` | `public Duration` | `previous()` Returns a Duration that is one second shorter than this duration.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public Duration div(long scalar)

      Supports the division operator; equivalent to calling the Duration.dividedBy method.

      Parameters:
        `scalar` - the value to divide by
      Returns:
        a Duration
      Since:
        2.5.0

    - #### public boolean isNonnegative()

      Returns true if this duration is zero or positive.

      Returns:
        true if nonnegative
      Since:
        2.5.0

    - #### public boolean isNonpositive()

      Returns true if this duration is zero or negative.

      Returns:
        true if nonpositive
      Since:
        2.5.0

    - #### public boolean isPositive()

      Returns true if this duration is positive, excluding zero.

      Returns:
        true if positive
      Since:
        2.5.0

    - #### public Duration minus(long seconds)

      Returns a Duration that is `seconds` seconds shorter that this duration.

      Parameters:
        `seconds` - the number of seconds to subtract
      Returns:
        a Duration
      Since:
        2.5.0

    - #### public Duration multiply(long scalar)

      Supports the multiplication operator; equivalent to calling the Duration.multipliedBy method.

      Parameters:
        `scalar` - the value to multiply by
      Returns:
        a Duration
      Since:
        2.5.0

    - #### public Duration negative()

      Supports the unary minus operator; equivalent to calling the Duration.negated method.

      Returns:
        a Duration
      Since:
        2.5.0

    - #### public Duration next()

      Returns a Duration that is one second longer than this duration.

      Returns:
        a Duration
      Since:
        2.5.0

    - #### public Duration plus(long seconds)

      Returns a Duration that is `seconds` seconds longer than this duration.

      Parameters:
        `seconds` - the number of seconds to add
      Returns:
        a Duration
      Since:
        2.5.0

    - #### public Duration positive()

      Supports the unary plus operator; equivalent to calling the Duration.abs method.

      Returns:
        a Duration
      Since:
        2.5.0

    - #### public Duration previous()

      Returns a Duration that is one second shorter than this duration.

      Returns:
        a Duration
      Since:
        2.5.0