# TemporalAdjuster

public interface **TemporalAdjuster**

|---|---|---|
| Known Indirect Subclasses [ChronoLocalDate](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/ChronoLocalDate.html), [ChronoLocalDateTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/ChronoLocalDateTime.html)\<D extends [ChronoLocalDate](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/ChronoLocalDate.html)\>, [DayOfWeek](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/DayOfWeek.html), [Era](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/Era.html), [Instant](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Instant.html), [IsoEra](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/IsoEra.html), [LocalDate](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/LocalDate.html), [LocalDateTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/LocalDateTime.html), [LocalTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/LocalTime.html), [Month](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Month.html), [MonthDay](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/MonthDay.html), [OffsetDateTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/OffsetDateTime.html), [OffsetTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/OffsetTime.html), [Year](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Year.html), [YearMonth](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/YearMonth.html), [ZoneOffset](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/ZoneOffset.html) |---|---| | [ChronoLocalDate](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/ChronoLocalDate.html) | A date without time-of-day or time-zone in an arbitrary chronology, intended for advanced globalization use cases. | | [ChronoLocalDateTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/ChronoLocalDateTime.html)\<D extends [ChronoLocalDate](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/ChronoLocalDate.html)\> | A date-time without a time-zone in an arbitrary chronology, intended for advanced globalization use cases. | | [DayOfWeek](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/DayOfWeek.html) | A day-of-week, such as 'Tuesday'. | | [Era](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/Era.html) | An era of the time-line. | | [Instant](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Instant.html) | An instantaneous point on the time-line. | | [IsoEra](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/chrono/IsoEra.html) | An era in the ISO calendar system. | | [LocalDate](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/LocalDate.html) | A date without a time-zone in the ISO-8601 calendar system, such as `2007-12-03`. | | [LocalDateTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/LocalDateTime.html) | A date-time without a time-zone in the ISO-8601 calendar system, such as `2007-12-03T10:15:30`. | | [LocalTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/LocalTime.html) | A time without a time-zone in the ISO-8601 calendar system, such as `10:15:30`. | | [Month](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Month.html) | A month-of-year, such as 'July'. | | [MonthDay](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/MonthDay.html) | A month-day in the ISO-8601 calendar system, such as `--12-03`. | | [OffsetDateTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/OffsetDateTime.html) | A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as `2007-12-03T10:15:30+01:00`. | | [OffsetTime](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/OffsetTime.html) | A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as `10:15:30+01:00`. | | [Year](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Year.html) | A year in the ISO-8601 calendar system, such as `2007`. | | [YearMonth](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/YearMonth.html) | A year-month in the ISO-8601 calendar system, such as `2007-12`. | | [ZoneOffset](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/ZoneOffset.html) | A time-zone offset from Greenwich/UTC, such as `+02:00`. | |||

Strategy for adjusting a temporal object.


Adjusters are a key tool for modifying temporal objects.
They exist to externalize the process of adjustment, permitting different
approaches, as per the strategy design pattern.
Examples might be an adjuster that sets the date avoiding weekends, or one that
sets the date to the last day of the month.


There are two equivalent ways of using a `TemporalAdjuster`.
The first is to invoke the method on this interface directly.
The second is to use `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html#with(java.time.temporal.TemporalAdjuster)`:

```
   // these two lines are equivalent, but the second approach is recommended
   temporal = thisAdjuster.adjustInto(temporal);
   temporal = temporal.with(thisAdjuster);
 
```
It is recommended to use the second approach, `with(TemporalAdjuster)`, as it is a lot clearer to read in code.


The `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalAdjusters.html` class contains a standard set of adjusters,
available as static methods.
These include:

- finding the first or last day of the month
- finding the first day of next month
- finding the first or last day of the year
- finding the first day of next year
- finding the first or last day-of-week within a month, such as "first Wednesday in June"
- finding the next or previous day-of-week, such as "next Thursday"

<br />

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalAdjusters.html`

### Public Method Summary

|---|---|
| abstract [Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html) | [adjustInto](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalAdjuster.html#adjustInto(java.time.temporal.Temporal))([Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html) temporal) Adjusts the specified temporal object. |

## Public Methods

#### public abstract [Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html)
**adjustInto**
([Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html) temporal)

Adjusts the specified temporal object.


This adjusts the specified temporal object using the logic
encapsulated in the implementing class.
Examples might be an adjuster that sets the date avoiding weekends, or one that
sets the date to the last day of the month.


There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html#with(java.time.temporal.TemporalAdjuster)`:

```
   // these two lines are equivalent, but the second approach is recommended
   temporal = thisAdjuster.adjustInto(temporal);
   temporal = temporal.with(thisAdjuster);
 
```
It is recommended to use the second approach, `with(TemporalAdjuster)`, as it is a lot clearer to read in code.

<br />

##### Parameters

| temporal | the temporal object to adjust, not null |
|---|---|

##### Returns

- an object of the same observable type with the adjustment made, not null

##### Throws

| [DateTimeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/DateTimeException.html) | if unable to make the adjustment |
| [ArithmeticException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArithmeticException.html) | if numeric overflow occurs |
|---|---|