final case class DurationOps(underlying: Duration) extends AnyVal with Product with Serializable
- Alphabetic
- By Inheritance
- DurationOps
- Serializable
- Serializable
- Product
- Equals
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new DurationOps(underlying: Duration)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
def
*(scalar: Int): Duration
Obtains a copy of this duration multiplied by the scalar.
Obtains a copy of this duration multiplied by the scalar.
- Exceptions thrown
ArithmeticException
- if numeric overflow occurs
-
def
+(amount: Long, unit: TemporalUnit): Duration
Obtains a copy of this duration with a duration added measured in terms of the specified unit.
Obtains a copy of this duration with a duration added measured in terms of the specified unit.
- Exceptions thrown
ArithmeticException
- if numeric overflow occursUnsupportedTemporalTypeException
- if the unit is not supported
-
def
+(duration: Duration): Duration
Obtains a copy of this duration with the specified duration added.
Obtains a copy of this duration with the specified duration added.
- Exceptions thrown
ArithmeticException
- if numeric overflow occurs
-
def
-(amount: Long, unit: TemporalUnit): Duration
Obtains a copy of this duration with a duration subtracted measured in terms of the specified unit.
Obtains a copy of this duration with a duration subtracted measured in terms of the specified unit.
- Exceptions thrown
ArithmeticException
- if numeric overflow occursUnsupportedTemporalTypeException
- if the unit is not supported
-
def
-(duration: Duration): Duration
Obtains a copy of this duration with the specified duration subtracted.
Obtains a copy of this duration with the specified duration subtracted.
- Exceptions thrown
ArithmeticException
- if numeric overflow occurs
-
def
->[B](y: B): (DurationOps, B)
- Implicit
- This member is added by an implicit conversion from DurationOps to ArrowAssoc[DurationOps] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
def
/(divisor: Int): Duration
Obtains a copy of this duration divided by the divisor.
Obtains a copy of this duration divided by the divisor.
- Exceptions thrown
ArithmeticException
- if numeric overflow occurs
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
def
asConcurrentDuration: Duration
Obtains a scala.concurrent.duration.Duration from the value of this duration in nanoseconds.
Obtains a scala.concurrent.duration.Duration from the value of this duration in nanoseconds.
- Exceptions thrown
ArithmeticException
- if numeric overflow occurs
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
ensuring(cond: (DurationOps) ⇒ Boolean, msg: ⇒ Any): DurationOps
- Implicit
- This member is added by an implicit conversion from DurationOps to Ensuring[DurationOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (DurationOps) ⇒ Boolean): DurationOps
- Implicit
- This member is added by an implicit conversion from DurationOps to Ensuring[DurationOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): DurationOps
- Implicit
- This member is added by an implicit conversion from DurationOps to Ensuring[DurationOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): DurationOps
- Implicit
- This member is added by an implicit conversion from DurationOps to Ensuring[DurationOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from DurationOps to StringFormat[DurationOps] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
unary_!: Duration
Swaps the sign of the total length of this duration.
Swaps the sign of the total length of this duration. For example, PT1.3S will be returned as PT-1.3S.
- Exceptions thrown
ArithmeticException
- if numeric overflow occurs
- val underlying: Duration
-
def
→[B](y: B): (DurationOps, B)
- Implicit
- This member is added by an implicit conversion from DurationOps to ArrowAssoc[DurationOps] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
Shadowed Implicit Value Members
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from DurationOps to any2stringadd[DurationOps] performed by method any2stringadd in scala.Predef.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(durationOps: any2stringadd[DurationOps]).+(other)
- Definition Classes
- any2stringadd
Scala Time
scala-time is a simple Scala wrapper for easier use JDK 1.8.0 (Java 8) time APIs
Overview
The library is contained in the scalatime package which includes extension methods provided via implicit conversion methods to Scala value classes.
For usage examples see below: