final case class YearMonthOps(underlying: YearMonth) extends AnyVal with Product with Serializable
Enriches YearMonth instances with additional methods.
- Source
- YearMonthOps.scala
- Alphabetic
- By Inheritance
- YearMonthOps
- Serializable
- Product
- Equals
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new YearMonthOps(underlying: YearMonth)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##(): Int
- Definition Classes
- Any
- def +(months: Int): YearMonth
Obtains a java.time.YearMonth with the specified number of months added.
Obtains a java.time.YearMonth with the specified number of months added.
- Exceptions thrown
DateTimeException
if the result exceeds the supported range.
- def -(months: Int): YearMonth
Obtains a YearMonth with the specified number of months subtracted.
Obtains a YearMonth with the specified number of months subtracted.
- Exceptions thrown
DateTimeException
if the result exceeds the supported range.
- def ->[B](y: B): (YearMonthOps, B)
- Implicit
- This member is added by an implicit conversion from YearMonthOps toArrowAssoc[YearMonthOps] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- def /(day: Int): LocalDate
Obtains a java.time.LocalDate by combining this year-month with the specified day.
Obtains a java.time.LocalDate by combining this year-month with the specified day.
- Exceptions thrown
DateTimeException
if the day is invalid for the year-month
- def <(other: YearMonth): Boolean
Returns
true
if this year-month is before the specified one. - def <=(other: YearMonth): Boolean
Returns
true
if this year-month is equal to or before the specified one. - final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def >(other: YearMonth): Boolean
Returns
true
if this year-month is after the specified one. - def >=(other: YearMonth): Boolean
Returns
true
if this year-month is equal to or after the specified one. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ensuring(cond: (YearMonthOps) => Boolean, msg: => Any): YearMonthOps
- Implicit
- This member is added by an implicit conversion from YearMonthOps toEnsuring[YearMonthOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (YearMonthOps) => Boolean): YearMonthOps
- Implicit
- This member is added by an implicit conversion from YearMonthOps toEnsuring[YearMonthOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): YearMonthOps
- Implicit
- This member is added by an implicit conversion from YearMonthOps toEnsuring[YearMonthOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): YearMonthOps
- Implicit
- This member is added by an implicit conversion from YearMonthOps toEnsuring[YearMonthOps] 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 YearMonthOps toStringFormat[YearMonthOps] 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 productElementNames: Iterator[String]
- Definition Classes
- Product
- val underlying: YearMonth
- def |>(formatter: DateTimeFormatter): String
Formats this year-month using the specified formatter.
Formats this year-month using the specified formatter.
- Exceptions thrown
DateTimeException
- if an error occurs during printing
- def ▹(formatter: DateTimeFormatter): String
Shadowed Implicit Value Members
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from YearMonthOps toany2stringadd[YearMonthOps] 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:(yearMonthOps: any2stringadd[YearMonthOps]).+(other)
- Definition Classes
- any2stringadd
Deprecated Value Members
- def →[B](y: B): (YearMonthOps, B)
- Implicit
- This member is added by an implicit conversion from YearMonthOps toArrowAssoc[YearMonthOps] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
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: