public class DefaultingTemporalAccessor extends Object implements TemporalAccessor
TemporalAccessor to provide default values wherever possible instead of throwing unsupported field exceptions.
If working correctly, any DateTimeFormatter.parse(CharSequence) method
should be able to be passed to any Temporal.from(TemporalAccessor) static method (such as ZonedDateTime.from(TemporalAccessor)).
| Constructor and Description |
|---|
DefaultingTemporalAccessor(TemporalAccessor inner,
ZoneId zoneId)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
get(TemporalField field) |
long |
getLong(TemporalField field) |
boolean |
isSupported(TemporalField field) |
<R> R |
query(TemporalQuery<R> query) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrangepublic DefaultingTemporalAccessor(TemporalAccessor inner, ZoneId zoneId)
inner - The temporal accessor being wrapped.zoneId - The default zone ID if it's not specified in the accessor.public boolean isSupported(TemporalField field)
isSupported in interface TemporalAccessorpublic <R> R query(TemporalQuery<R> query)
query in interface TemporalAccessorpublic long getLong(TemporalField field)
getLong in interface TemporalAccessorpublic int get(TemporalField field)
get in interface TemporalAccessorCopyright © 2016–2019 The Apache Software Foundation. All rights reserved.