Language

MonthDay.AdjustInto(ITemporal) Method

Definition

Adjusts the specified temporal object to have this month and, when valid, this day.

[Android.Runtime.Register("adjustInto", "(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;", "", ApiSince=26)]
public Java.Time.Temporal.ITemporal? AdjustInto(Java.Time.Temporal.ITemporal? temporal);
[<Android.Runtime.Register("adjustInto", "(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;", "", ApiSince=26)>]
abstract member AdjustInto : Java.Time.Temporal.ITemporal -> Java.Time.Temporal.ITemporal
override this.AdjustInto : Java.Time.Temporal.ITemporal -> Java.Time.Temporal.ITemporal

Parameters

temporal
ITemporal

the target object to be adjusted, not null

Returns

the adjusted object, not null

Implements

Attributes

Remarks

Adjusts the specified temporal object to have this month and, when valid, this day. This returns a temporal object of the same observable type as the input. The adjustment uses Temporal.with(TemporalField, long) twice: first to set ChronoField.MONTH_OF_YEAR, then to set ChronoField.DAY_OF_MONTH to the smaller of this day and the maximum valid day in the adjusted temporal object. For example, February 29 becomes February 28 in a non-leap year. If the specified temporal object does not use the ISO calendar system then a DateTimeException is thrown. In most cases, it is clearer to reverse the calling pattern by using Temporal.with(TemporalAdjuster):

// these two lines are equivalent, but the second approach is recommended
temporal = thisMonthDay.adjustInto(temporal);
temporal = temporal.with(thisMonthDay);

This instance is immutable and unaffected by this method call.

Java reference for java.time.MonthDay.adjustInto.

Applies to