Top Description Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractYearMonthAssert<SELF extends AbstractYearMonthAssert<SELF>>

extends AbstractTemporalAssert<SELF extends AbstractYearMonthAssert<SELF>, YearMonth>
Class Inheritance
Known Direct Subclasses
org.assertj.core.api.YearMonthAssert
Annotations
@SuppressWarnings:GrazieInspection
Type Parameters
<SELF>
the "self" type of this assertion class.
Static Imports
org.assertj.core.error.ShouldBeAfter.shouldBeAfter, .ShouldBeAfterOrEqualTo.shouldBeAfterOrEqualTo, .ShouldBeBefore.shouldBeBefore, .ShouldBeBeforeOrEqualTo.shouldBeBeforeOrEqualTo, .ShouldBeCurrentYearMonth.shouldBeCurrentYearMonth, .ShouldBeInTheFuture.shouldBeInTheFuture, .ShouldBeInThePast.shouldBeInThePast, .ShouldHaveDateField.shouldHaveDateField, .ShouldHaveDateField.shouldHaveMonth, org.assertj.core.util.Preconditions.checkArgument

Base class for all implementations of assertions for YearMonth type from new Date & Time API introduced in Java 8.
Since
3.26.0

Field Summary

Inherited from org.assertj.core.api.AbstractTemporalAssert:
comparables

Constructor Summary

AccessConstructor and Description
protected
AbstractYearMonthAssert(YearMonth
the actual value to verify.
actual
,
Class<?>
the "self-type".
selfType
)

Creates a new AbstractYearMonthAssert.

Method Summary

Modifier and TypeMethod and Description
private static void
assertYearMonthAsStringParameterIsNotNull(String
string representing the YearMonth to compare actual with.
otherYearMonthAsString
)

Check that the YearMonth string representation to compare actual YearMonth to is not null, otherwise throws a IllegalArgumentException with an explicit message.

private static void
assertYearMonthParameterIsNotNull(YearMonth
the YearMonth to check.
other
)

Check that the YearMonth to compare actual YearMonth to is not null, in that case throws a IllegalArgumentException with an explicit message.

private static void
private static Object[]
convertToYearMonthArray(String... yearMonthsAsString)

public SELF

Returns:

this assertion object.
hasMonth
(Month
the given Month.
month
)

Verifies that the actual YearMonth is in the given month.

public SELF

Returns:

this assertion object.
hasMonthValue
(int
the given month's value between 1 and 12 inclusive.
month
)

Verifies that the actual YearMonth is in the given month.

public SELF

Returns:

this assertion object.
hasYear
(int
the given year.
year
)

Verifies that the actual YearMonth is in the given year.

public SELF

Returns:

this assertion object.
isAfter
(YearMonth
the other YearMonth to compare to, not null.
other
)

Verifies that the actual YearMonth is strictly after the given one.

public SELF

Returns:

this assertion object.
isAfter
(String
string representation of the other YearMonth to compare to, not null.
otherYearMonthAsString
)

Verifies that the actual YearMonth is strictly after the given one.

public SELF

Returns:

this assertion object.
isAfterOrEqualTo
(YearMonth
the other YearMonth to compare to, not null.
other
)

Verifies that the actual YearMonth is after or equal to the given one.

public SELF

Returns:

this assertion object.
isAfterOrEqualTo
(String
string representation of the other YearMonth to compare to, not null.
otherYearMonthAsString
)

Verifies that the actual YearMonth is after or equal to the given one.

public SELF

Returns:

this assertion object.
isBefore
(YearMonth
the other YearMonth to compare to, not null.
other
)

Verifies that the actual YearMonth is strictly before the given one.

public SELF

Returns:

this assertion object.
isBefore
(String
string representation of the other YearMonth to compare to, not null.
otherYearMonthAsString
)

Verifies that the actual YearMonth is strictly before the given one.

public SELF

Returns:

this assertion object.
isBeforeOrEqualTo
(YearMonth
the other YearMonth to compare to, not null.
other
)

Verifies that the actual YearMonth is before or equal to the given one.

public SELF

Returns:

this assertion object.
isBeforeOrEqualTo
(String
string representation of the other YearMonth to compare to, not null.
otherYearMonthAsString
)

Verifies that the actual YearMonth is before or equal to the given one.

public SELF

Returns:

this assertion object.
isBetween
(YearMonth
the start value (inclusive), not null.
startInclusive
,
YearMonth
the end value (inclusive), not null.
endInclusive
)

Verifies that the actual YearMonth is in the [start, end] period (start and end included).

public SELF

Returns:

this assertion object.
isBetween
(String
the start value (inclusive), not null.
startInclusive
,
String
the end value (inclusive), not null.
endInclusive
)

Verifies that the actual YearMonth is in the [start, end] period (start and end included).

public SELF

Returns:

this assertion object.
isCurrentYearMonth
()

Verifies that the actual YearMonth is the current YearMonth.

public SELF

Returns:

this assertion object.
isEqualTo
(String
string representation of the other YearMonth to compare to, not null.
otherYearMonthAsString
)

Verifies that the actual YearMonth is equal to the given one.

public SELF

Returns:

this assertion object.
isIn
(String...
string array representing YearMonths.
otherYearMonthsAsString
)

Verifies that the actual YearMonth is present in the given array of values.

public SELF

Returns:

this assertion object.
isInTheFuture
()

Verifies that the actual YearMonth is strictly in the future.

public SELF

Returns:

this assertion object.
isInThePast
()

Verifies that the actual YearMonth is strictly in the past.

public SELF

Returns:

this assertion object.
isNotEqualTo
(String
string representation of the other YearMonth to compare to, not null.
otherYearMonthAsString
)

Verifies that the actual YearMonth is not equal to the given one.

public SELF

Returns:

this assertion object.
isNotIn
(String...
Array of string representing a YearMonth.
otherYearMonthsAsString
)

Verifies that the actual YearMonth is not present in the given array of values.

public SELF

Returns:

this assertion object.
isStrictlyBetween
(YearMonth
the start value (exclusive), not null.
startExclusive
,
YearMonth
the end value (exclusive), not null.
endExclusive
)

Verifies that the actual YearMonth is in the ]start, end[ period (start and end excluded).

public SELF

Returns:

this assertion object.
isStrictlyBetween
(String
the start value (exclusive), not null.
startExclusive
,
String
the end value (exclusive), not null.
endExclusive
)

Verifies that the actual YearMonth is in the ]start, end[ period (start and end excluded).

protected YearMonth
parse(String
the string to parse, not null
yearMonthAsString
)

Implements abstract org.assertj.core.api.AbstractTemporalAssert.parse.

Obtains an instance of YearMonth from a text string such as 2007-12.
Inherited from org.assertj.core.api.AbstractTemporalAssert:
getActualisCloseToisCloseTousingComparatorusingComparatorusingDefaultComparator

Constructor Detail

AbstractYearMonthAssertback to summary
protected AbstractYearMonthAssert(YearMonth actual, Class<?> selfType)

Creates a new AbstractYearMonthAssert.

Parameters
actual:YearMonth

the actual value to verify.

selfType:Class<?>

the "self-type".

Method Detail

assertYearMonthAsStringParameterIsNotNullback to summary
private static void assertYearMonthAsStringParameterIsNotNull(String otherYearMonthAsString)

Check that the YearMonth string representation to compare actual YearMonth to is not null, otherwise throws a IllegalArgumentException with an explicit message.

Parameters
otherYearMonthAsString:String

string representing the YearMonth to compare actual with.

Exceptions
IllegalArgumentException:
with an explicit message if the given String is null.
assertYearMonthParameterIsNotNullback to summary
private static void assertYearMonthParameterIsNotNull(YearMonth other)

Check that the YearMonth to compare actual YearMonth to is not null, in that case throws a IllegalArgumentException with an explicit message.

Parameters
other:YearMonth

the YearMonth to check.

Exceptions
IllegalArgumentException:
with an explicit message if the given YearMonth is null.
checkIsNotNullAndNotEmptyback to summary
private static void checkIsNotNullAndNotEmpty(Object[] values)
convertToYearMonthArrayback to summary
private static Object[] convertToYearMonthArray(String... yearMonthsAsString)
hasMonthback to summary
public SELF hasMonth(Month month)

Verifies that the actual YearMonth is in the given month.

Example:

 // assertion succeeds:
assertThat(YearMonth.of(2000, 12)).hasMonth(Month.DECEMBER);

// assertion fails:
assertThat(YearMonth.of(2000, 12)).hasMonth(Month.JANUARY);
Parameters
month:Month

the given Month.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not in the given month.
hasMonthValueback to summary
public SELF hasMonthValue(int month)

Verifies that the actual YearMonth is in the given month.

Example:

 // assertion succeeds:
assertThat(YearMonth.of(2000, 12)).hasMonthValue(12);

// assertion fails:
assertThat(YearMonth.of(2000, 12)).hasMonthValue(11);
Parameters
month:int

the given month's value between 1 and 12 inclusive.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not in the given month.
hasYearback to summary
public SELF hasYear(int year)

Verifies that the actual YearMonth is in the given year.

Example:

 // assertion succeeds:
assertThat(YearMonth.of(2000, 12)).hasYear(2000);

// assertion fails:
assertThat(YearMonth.of(2000, 12)).hasYear(2001);
Parameters
year:int

the given year.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not in the given year.
isAfterback to summary
public SELF isAfter(YearMonth other)

Verifies that the actual YearMonth is strictly after the given one.

Example:

 assertThat(YearMonth.of(2000, 1)).isAfter(parse("1999-12"));
Parameters
other:YearMonth

the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not strictly after the given one.
IllegalArgumentException:
if other YearMonth is null.
isAfterback to summary
public SELF isAfter(String otherYearMonthAsString)

Verifies that the actual YearMonth is strictly after the given one.

Same assertion as isAfter(YearMonth) but the YearMonth is built from given string, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isAfter("1999-12");
Parameters
otherYearMonthAsString:String

string representation of the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not strictly after the YearMonth built from given string.
IllegalArgumentException:
if the given string is null.
DateTimeParseException:
if the given string cannot be parsed to a YearMonth.
isAfterOrEqualToback to summary
public SELF isAfterOrEqualTo(YearMonth other)

Verifies that the actual YearMonth is after or equal to the given one.

Example:

 assertThat(YearMonth.of(2000, 1)).isAfterOrEqualTo(YearMonth.of(2000, 1))
                                 .isAfterOrEqualTo(parse("1999-12"));
Parameters
other:YearMonth

the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not after or equal to the given one.
IllegalArgumentException:
if other YearMonth is null.
isAfterOrEqualToback to summary
public SELF isAfterOrEqualTo(String otherYearMonthAsString)

Verifies that the actual YearMonth is after or equal to the given one.

Same assertion as isAfterOrEqualTo(YearMonth) but the YearMonth is built from given string, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isAfterOrEqualTo("2000-01")
                                 .isAfterOrEqualTo("1999-12");
Parameters
otherYearMonthAsString:String

string representation of the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not after or equal to the YearMonth built from given string.
IllegalArgumentException:
if the given string is null.
DateTimeParseException:
if the given string cannot be parsed to a YearMonth.
isBeforeback to summary
public SELF isBefore(YearMonth other)

Verifies that the actual YearMonth is strictly before the given one.

Example:

 assertThat(YearMonth.of(2000, 1)).isBefore(YearMonth.of(2000, 2));
Parameters
other:YearMonth

the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not strictly before the given one.
IllegalArgumentException:
if other YearMonth is null.
isBeforeback to summary
public SELF isBefore(String otherYearMonthAsString)

Verifies that the actual YearMonth is strictly before the given one.

Same assertion as isBefore(YearMonth) but the YearMonth is built from the given string, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isBefore("2000-02");
Parameters
otherYearMonthAsString:String

string representation of the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not strictly before the YearMonth built from given string.
IllegalArgumentException:
if the given string is null.
DateTimeParseException:
if the given string cannot be parsed to a YearMonth.
isBeforeOrEqualToback to summary
public SELF isBeforeOrEqualTo(YearMonth other)

Verifies that the actual YearMonth is before or equal to the given one.

Example:

 assertThat(YearMonth.of(2000, 1)).isBeforeOrEqualTo(YearMonth.of(2000, 1))
                                 .isBeforeOrEqualTo(YearMonth.of(2000, 2));
Parameters
other:YearMonth

the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not before or equal to the given one.
IllegalArgumentException:
if other YearMonth is null.
isBeforeOrEqualToback to summary
public SELF isBeforeOrEqualTo(String otherYearMonthAsString)

Verifies that the actual YearMonth is before or equal to the given one.

Same assertion as isBeforeOrEqualTo(YearMonth) but the YearMonth is built from given string, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isBeforeOrEqualTo("2000-01")
                                 .isBeforeOrEqualTo("2000-02");
Parameters
otherYearMonthAsString:String

string representation of the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not before or equal to the YearMonth built from given string.
IllegalArgumentException:
if the given string is null.
DateTimeParseException:
if the given string cannot be parsed to a YearMonth.
isBetweenback to summary
public SELF isBetween(YearMonth startInclusive, YearMonth endInclusive)

Verifies that the actual YearMonth is in the [start, end] period (start and end included).

Example:

 YearMonth yearMonth = YearMonth.now();

// assertions succeed:
assertThat(yearMonth).isBetween(yearMonth.minusMonths(1), yearMonth.plusMonths(1))
                     .isBetween(yearMonth, yearMonth.plusMonths(1))
                     .isBetween(yearMonth.minusMonths(1), yearMonth)
                     .isBetween(yearMonth, yearMonth);

// assertions fail:
assertThat(yearMonth).isBetween(yearMonth.minusMonths(10), yearMonth.minusMonths(1));
assertThat(yearMonth).isBetween(yearMonth.plusMonths(1), yearMonth.plusMonths(10));
Parameters
startInclusive:YearMonth

the start value (inclusive), not null.

endInclusive:YearMonth

the end value (inclusive), not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in [start, end] period.
NullPointerException:
  • if start value is null.
  • if end value is null.
isBetweenback to summary
public SELF isBetween(String startInclusive, String endInclusive)

Verifies that the actual YearMonth is in the [start, end] period (start and end included).

Same assertion as isBetween(YearMonth, YearMonth) but the YearMonths are built from given strings, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 YearMonth january2000 = YearMonth.parse("2000-01");

// assertions succeed:
assertThat(january2000).isBetween("1999-01", "2001-01")
                       .isBetween("2000-01", "2001-01")
                       .isBetween("1999-01", "2000-01")
                       .isBetween("2000-01", "2000-01");

// assertion fails:
assertThat(january2000).isBetween("1999-01", "1999-12");
Parameters
startInclusive:String

the start value (inclusive), not null.

endInclusive:String

the end value (inclusive), not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in [start, end] period.
NullPointerException:
  • if start value is null.
  • if end value is null.
DateTimeParseException:
if any of the given string can't be converted to a YearMonth.
isCurrentYearMonthback to summary
public SELF isCurrentYearMonth()

Verifies that the actual YearMonth is the current YearMonth.

Example:

 // assertion succeeds:
assertThat(YearMonth.now()).isCurrentYearMonth();

// assertion fails:
assertThat(theFellowshipOfTheRing.getReleaseDate()).isCurrentYearMonth();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not the current YearMonth.
isEqualToback to summary
public SELF isEqualTo(String otherYearMonthAsString)

Verifies that the actual YearMonth is equal to the given one.

Same assertion as isEqualTo(Object) but the YearMonth is built from given string, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isEqualTo("2000-01");
Parameters
otherYearMonthAsString:String

string representation of the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not equal to the YearMonth built from given string.
IllegalArgumentException:
if the given string is null.
DateTimeParseException:
if the given string cannot be parsed to a YearMonth.
isInback to summary
public SELF isIn(String... otherYearMonthsAsString)

Verifies that the actual YearMonth is present in the given array of values.

Same assertion as isIn(Object...) but the YearMonths are built from given strings, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isIn("1999-12", "2000-01");
Parameters
otherYearMonthsAsString:String[]

string array representing YearMonths.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not in the YearMonths built from given strings.
IllegalArgumentException:
if any of the given strings is null.
DateTimeParseException:
if any of the given strings cannot be parsed to a YearMonth.
isInTheFutureback to summary
public SELF isInTheFuture()

Verifies that the actual YearMonth is strictly in the future.

Example:

 // assertion succeeds:
assertThat(YearMonth.now().plusMonths(1)).isInTheFuture();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not in the future.
isInThePastback to summary
public SELF isInThePast()

Verifies that the actual YearMonth is strictly in the past.

Example:

 // assertion succeeds:
assertThat(YearMonth.now().minusMonths(1)).isInThePast();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is not in the past.
isNotEqualToback to summary
public SELF isNotEqualTo(String otherYearMonthAsString)

Verifies that the actual YearMonth is not equal to the given one.

Same assertion as isNotEqualTo(Object) but the YearMonth is built from given string, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isNotEqualTo("2000-02");
Parameters
otherYearMonthAsString:String

string representation of the other YearMonth to compare to, not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is equal to the YearMonth built from given string.
IllegalArgumentException:
if the given string is null.
DateTimeParseException:
if the given string cannot be parsed to a YearMonth.
isNotInback to summary
public SELF isNotIn(String... otherYearMonthsAsString)

Verifies that the actual YearMonth is not present in the given array of values.

Same assertion as isNotIn(Object...) but the YearMonths are built from given strings, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 // use string representation of YearMonth
assertThat(YearMonth.of(2000, 1)).isNotIn("1999-12", "2000-02");
Parameters
otherYearMonthsAsString:String[]

Array of string representing a YearMonth.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual YearMonth is null.
  • if the actual YearMonth is in the YearMonths built from given strings.
IllegalArgumentException:
if any of the given strings is null.
DateTimeParseException:
if any of the given strings cannot be parsed to a YearMonth.
isStrictlyBetweenback to summary
public SELF isStrictlyBetween(YearMonth startExclusive, YearMonth endExclusive)

Verifies that the actual YearMonth is in the ]start, end[ period (start and end excluded).

Example:

 YearMonth yearMonth = YearMonth.now();

// assertion succeeds:
assertThat(yearMonth).isStrictlyBetween(yearMonth.minusMonths(1), yearMonth.plusMonths(1));

// assertions fail:
assertThat(yearMonth).isStrictlyBetween(yearMonth.minusMonths(10), yearMonth.minusMonths(1));
assertThat(yearMonth).isStrictlyBetween(yearMonth.plusMonths(1), yearMonth.plusMonths(10));
assertThat(yearMonth).isStrictlyBetween(yearMonth, yearMonth.plusMonths(1));
assertThat(yearMonth).isStrictlyBetween(yearMonth.minusMonths(1), yearMonth);
Parameters
startExclusive:YearMonth

the start value (exclusive), not null.

endExclusive:YearMonth

the end value (exclusive), not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in ]start, end[ period.
NullPointerException:
  • if start value is null.
  • if end value is null.
isStrictlyBetweenback to summary
public SELF isStrictlyBetween(String startExclusive, String endExclusive)

Verifies that the actual YearMonth is in the ]start, end[ period (start and end excluded).

Same assertion as isStrictlyBetween(YearMonth, YearMonth) but the YearMonths are built from given strings, which must follow the DateTimeFormatter pattern uuuu-MM to allow calling YearMonth#parse(CharSequence) method.

Example:

 YearMonth january2000 = YearMonth.parse("2000-01");

// assertion succeeds:
assertThat(january2000).isStrictlyBetween("1999-01", "2001-01");

// assertions fail:
assertThat(january2000).isStrictlyBetween("1999-01", "1999-12");
assertThat(january2000).isStrictlyBetween("2000-01", "2001-01");
assertThat(january2000).isStrictlyBetween("1999-01", "2000-01");
Parameters
startExclusive:String

the start value (exclusive), not null.

endExclusive:String

the end value (exclusive), not null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in ]start, end[ period.
NullPointerException:
  • if start value is null.
  • if end value is null.
DateTimeParseException:
if any of the given string can't be converted to a YearMonth.
parseback to summary
protected YearMonth parse(String yearMonthAsString)

Implements abstract org.assertj.core.api.AbstractTemporalAssert.parse.

Obtains an instance of YearMonth from a text string such as 2007-12.

Parameters
yearMonthAsString:String

Doc from org.assertj.core.api.AbstractTemporalAssert.parse.

the string to parse, not null

Returns:YearMonth

Doc from org.assertj.core.api.AbstractTemporalAssert.parse.

the parsed TEMPORAL, not null

Annotations
@Override
See Also
YearMonth#parse(CharSequence)