Class StdOperator<T extends ChronoEntity<T>>
- Type Parameters:
T
- generic target type of operator
- All Implemented Interfaces:
Function<T,T>
,UnaryOperator<T>
,ChronoOperator<T>
Factory for producing standard chronological operators which are applicable on most chronological entities.
- Since:
- 3.5/4.3
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionAdjusts given entity and yields a changed copy of argument.static <T extends ChronoEntity<T>>
ChronoOperator<T>atCeiling(ChronoElement<?> element)
Yields an operator which rounds any entity up so that the child elements will be set to the maximum.static <T extends ChronoEntity<T>>
ChronoOperator<T>atFloor(ChronoElement<?> element)
Yields an operator which rounds any entity down so that the child elements will be set to the minimum.static <T extends ChronoEntity<T>>
ChronoOperator<T>decremented(ChronoElement<?> element)
Yields a new operator which can set any entity such that its actual element value gets the decremented value.static <T extends ChronoEntity<T>>
ChronoOperator<T>incremented(ChronoElement<?> element)
Yields a new operator which can set any entity such that its actual element value gets the incremented value.static <T extends ChronoEntity<T>>
ChronoOperator<T>maximized(ChronoElement<?> element)
Yields a new operator which can set any entity to its maximum element value.static <T extends ChronoEntity<T>>
ChronoOperator<T>minimized(ChronoElement<?> element)
Yields a new operator which can set any entity to its minimum element value.static <T extends ChronoEntity<T>, V>
ChronoOperator<T>newValue(V value, ChronoElement<V> element)
Yields an operator which sets any entity such that its actual element value will be set in normal mode to given value.static <T extends ChronoEntity<T>, V>
ChronoOperator<T>setLenient(V value, ChronoElement<V> element)
Yields an operator which sets any entity such that its actual element value will be set in lenient mode to given value.
-
Method Details
-
apply
Description copied from interface:ChronoOperator
Adjusts given entity and yields a changed copy of argument.
Will be called by
ChronoEntity.with(ChronoOperator)
.- Specified by:
apply
in interfaceChronoOperator<T extends ChronoEntity<T>>
- Specified by:
apply
in interfaceFunction<T extends ChronoEntity<T>,T extends ChronoEntity<T>>
- Parameters:
entity
- chronological entity to be adjusted- Returns:
- adjusted copy of argument which itself remains unaffected
-
minimized
Yields a new operator which can set any entity to its minimum element value.
- Type Parameters:
T
- generic type of target entity- Parameters:
element
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
-
maximized
Yields a new operator which can set any entity to its maximum element value.
- Type Parameters:
T
- generic type of target entity- Parameters:
element
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
-
decremented
Yields a new operator which can set any entity such that its actual element value gets the decremented value.
- Type Parameters:
T
- generic type of target entity- Parameters:
element
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
- See Also:
TimeAxis.getBaseUnit(ChronoElement)
-
incremented
Yields a new operator which can set any entity such that its actual element value gets the incremented value.
- Type Parameters:
T
- generic type of target entity- Parameters:
element
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
- See Also:
TimeAxis.getBaseUnit(ChronoElement)
-
atFloor
Yields an operator which rounds any entity down so that the child elements will be set to the minimum.
- Type Parameters:
T
- generic type of target entity- Parameters:
element
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
-
atCeiling
Yields an operator which rounds any entity up so that the child elements will be set to the maximum.
- Type Parameters:
T
- generic type of target entity- Parameters:
element
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
-
setLenient
public static <T extends ChronoEntity<T>, V> ChronoOperator<T> setLenient(V value, ChronoElement<V> element)Yields an operator which sets any entity such that its actual element value will be set in lenient mode to given value.
- Type Parameters:
T
- generic type of target entityV
- generic element value type- Parameters:
value
- new element valueelement
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
-
newValue
public static <T extends ChronoEntity<T>, V> ChronoOperator<T> newValue(V value, ChronoElement<V> element)Yields an operator which sets any entity such that its actual element value will be set in normal mode to given value.
- Type Parameters:
T
- generic type of target entityV
- generic element value type- Parameters:
value
- new element valueelement
- associated chronological element- Returns:
- operator
- Since:
- 3.5/4.3
-