T - generic type of time context compatible to ChronoEntitypublic interface IntElementRule<T> extends ElementRule<T,Integer>
Element rule with support for int-primitives.
| Modifier and Type | Method and Description |
|---|---|
int |
getInt(T context)
Yields the current value of associated element in given
chronological context.
|
boolean |
isValid(T context,
int value)
Queries if given value is valid for the element associated with this
rule in given context.
|
T |
withValue(T context,
int value,
boolean lenient)
Determines the new value of the associated element in given
chronological context and yields the result.
|
getChildAtCeiling, getChildAtFloor, getMaximum, getMinimum, getValue, isValid, withValueint getInt(T context)
Yields the current value of associated element in given chronological context.
Will be called by ChronoEntity.getInt(ChronoElement).
context - time context to be evaluatedChronoException - if the associated element value cannot be evaluatedboolean isValid(T context, int value)
Queries if given value is valid for the element associated with this rule in given context.
Will be called by ChronoEntity.isValid(ChronoElement, int).
A numerical overflow causing an ArithmeticException will usually
not be checked.
context - time context to be evaluatedvalue - candidate value to be validatedtrue if valid else falseT withValue(T context, int value, boolean lenient)
Determines the new value of the associated element in given chronological context and yields the result.
Will be called by ChronoEntity.with(ChronoElement, int).
The lenient mode causes the tolerant interpretation of invalid
values like 31st of April as 1st of May. This mode is only
active if an element is either explicitly declared as lenient or if
the method StdOperator.setLenient() is used.
context - time context to be evaluatedvalue - new element valuelenient - leniency modeIllegalArgumentException - if given value is out of range or
not valid dependent on the given time contextArithmeticException - in case of numerical overflowisValid(Object, int),
StdOperator.setLenient(Object, ChronoElement),
ChronoElement.isLenient(),
ProportionalElement.setLenient(Number)Copyright © 2014–2017. All rights reserved.