Package: java.time

## [Java] Class YearMonth

- java.time.YearMonth

-     public class YearMonth
      extends Object

  GDK enhancements for YearMonth.

  displayName:
    YearMonth
  receiverFqcn:
    java.time.YearMonth

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public LocalDate` | `leftShift(int dayOfMonth)` Returns a LocalDate of this year/month and the given day of the month.
    `` | `public YearMonth` | `minus(long months)` Returns a YearMonth that is `months` months before this year/month.
    `` | `public YearMonth` | `next()` Returns a YearMonth that is the month after this year/month.
    `` | `public static YearMonth` | `parse(YearMonth type, CharSequence text, String pattern)` Parse text into a YearMonth using the provided pattern.
    `` | `public YearMonth` | `plus(long months)` Returns a YearMonth that is `months` months after this year/month.
    `` | `public YearMonth` | `previous()` Returns a YearMonth that is the month before this year/month.
    `` | `public Period` | `rightShift(YearMonth other)` Returns a Period of time between the first day of this year/month (inclusive) and the given YearMonth (exclusive).

  - ### 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, 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 LocalDate leftShift(int dayOfMonth)

      Returns a LocalDate of this year/month and the given day of the month.

      Parameters:
        `dayOfMonth` - a day of the month
      Returns:
        a LocalDate
      Since:
        2.5.0

    - #### public YearMonth minus(long months)

      Returns a YearMonth that is `months` months before this year/month.

      Parameters:
        `months` - the number of months to subtract
      Returns:
        a Year
      Since:
        2.5.0

    - #### public YearMonth next()

      Returns a YearMonth that is the month after this year/month.

      Returns:
        the next YearMonth
      Since:
        2.5.0

    - #### public static YearMonth parse(YearMonth type, CharSequence text, String pattern)

      Parse text into a YearMonth using the provided pattern.

      throws:
        java.lang.IllegalArgumentException if the pattern is invalid
      throws:
        java.time.format.DateTimeParseException if the text cannot be parsed
      Parameters:
        `type` - placeholder variable used by Groovy categories; ignored for default static methods
        `text` - String to be parsed to create the date instance
        `pattern` - pattern used to parse the text
      Returns:
        a YearMonth representing the parsed text
      See Also:
        DateTimeFormatter
        YearMonth.parse
      Since:
        2.5.0

    - #### public YearMonth plus(long months)

      Returns a YearMonth that is `months` months after this year/month.

      Parameters:
        `months` - the number of months to add
      Returns:
        a Year
      Since:
        2.5.0

    - #### public YearMonth previous()

      Returns a YearMonth that is the month before this year/month.

      Returns:
        the previous YearMonth
      Since:
        2.5.0

    - #### public Period rightShift(YearMonth other)

      Returns a Period of time between the first day of this year/month (inclusive) and the given YearMonth (exclusive).

      Parameters:
        `other` - another YearMonth
      Returns:
        a Period
      Since:
        2.5.0