OffsetTime._with

Returns an adjusted copy of this time. !(p) This returns an {@code OffsetTime}, based on this one, with the time adjusted. The adjustment takes place using the specified adjuster strategy object. Read the documentation of the adjuster to understand what adjustment will be made. !(p) A simple adjuster might simply set the one of the fields, such as the hour field. A more complex adjuster might set the time to the last hour of the day. !(p) The classes {@link LocalTime} and {@link ZoneOffset} implement {@code TemporalAdjuster}, thus this method can be used to change the time or offset: !(pre) result = offsetTime._with(time); result = offsetTime._with(offset); </pre> !(p) The result of this method is obtained by invoking the {@link TemporalAdjuster#adjustInto(Temporal)} method on the specified adjuster passing {@code this} as the argument. !(p) This instance is immutable and unaffected by this method call.

@param adjuster the adjuster to use, not null @return an {@code OffsetTime} based on {@code this} with the adjustment made, not null @throws DateTimeException if the adjustment cannot be made @throws ArithmeticException if numeric overflow occurs

  1. OffsetTime _with(TemporalAdjuster adjuster)
    class OffsetTime
  2. OffsetTime _with(TemporalField field, long newValue)

Meta