DateTimeFormatterBuilder.optionalStart

Mark the start of an optional section. !(p) The output of formatting can include optional sections, which may be nested. An optional section is started by calling this method and ended by calling {@link #optionalEnd()} or by ending the build process. !(p) All elements _in the optional section are treated as optional. During formatting, the section is only output if data is available _in the {@code TemporalAccessor} for all the elements _in the section. During parsing, the whole section may be missing from the parsed string. !(p) For example, consider a builder setup as {@code builder.appendValue(HOUR_OF_DAY,2).optionalStart().appendValue(MINUTE_OF_HOUR,2)}. The optional section ends automatically at the end of the builder. During formatting, the minute will only be output if its value can be obtained from the date-time. During parsing, the input will be successfully parsed whether the minute is present or not.

@return this, for chaining, not null

class DateTimeFormatterBuilder
optionalStart
()

Meta