public interface Calendrical
All classes that can provide calendrical information should implement this interface.
The single method allows a calendrical to be queried to find the value of a rule.
A calendrical might be a single field, such as month-of-year or hour-of-day, or a
whole object, such as LocalDate
or ZoneOffset
.
Calendrical makes no guarantees about the thread-safety or immutability of implementations.
Modifier and Type | Method and Description |
---|---|
<T> T |
get(CalendricalRule<T> rule)
Gets the value of the specified calendrical rule.
|
<T> T get(CalendricalRule<T> rule)
This method queries the value of the specified rule.
If the rule is not supported then null
will be returned.
Where this method returns numeric values, Integer is the preferred type. The values should be within the range of the field wherever possible. For example, minute-of-hour should be from 0 to 59 inclusive. The calling code must validate the value however and not trust it to be valid.
rule
- the rule to query, not nullCopyright © 2014. All rights reserved.