Partial is an immutable partial datetime supporting any set of datetime fields.
A Partial instance can be used to hold any combination of fields. The instance does not contain a time zone, so any datetime is local.
A Partial can be matched against an instant using {@link #isMatch(ReadableInstant)}. This method compares each field on this partial with those of the instant and determines if the partial matches the instant. Given this definition, an empty Partial instance represents any datetime and always matches.
Calculations on Partial are performed using a {@link Chronology}. This chronology is set to be in the UTC time zone for all calculations.
Each individual field can be queried in two ways:
get(DateTimeFieldType.monthOfYear())
property(DateTimeFieldType.monthOfYear()).get()
The second technique also provides access to other useful methods on the field:
- numeric value -
monthOfYear().get()
- text value -
monthOfYear().getAsText()
- short text value -
monthOfYear().getAsShortText()
- maximum/minimum values -
monthOfYear().getMaximumValue()
- add/subtract -
monthOfYear().addToCopy()
- set -
monthOfYear().setCopy()
Partial is thread-safe and immutable, provided that the Chronology is as well. All standard Chronology classes supplied are thread-safe and immutable.
@author Stephen Colebourne
@since 1.1