Package org.openhab.core.items
Interface GroupFunction
- All Known Subinterfaces:
ArithmeticGroupFunction
,DateTimeGroupFunction
,QuantityTypeArithmeticGroupFunction
- All Known Implementing Classes:
ArithmeticGroupFunction.And
,ArithmeticGroupFunction.Avg
,ArithmeticGroupFunction.Count
,ArithmeticGroupFunction.Max
,ArithmeticGroupFunction.Median
,ArithmeticGroupFunction.Min
,ArithmeticGroupFunction.NAnd
,ArithmeticGroupFunction.NOr
,ArithmeticGroupFunction.Or
,ArithmeticGroupFunction.Sum
,ArithmeticGroupFunction.Xor
,DateTimeGroupFunction.Earliest
,DateTimeGroupFunction.Latest
,GroupFunction.Equality
,QuantityTypeArithmeticGroupFunction.Avg
,QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
,QuantityTypeArithmeticGroupFunction.Max
,QuantityTypeArithmeticGroupFunction.Median
,QuantityTypeArithmeticGroupFunction.Min
,QuantityTypeArithmeticGroupFunction.Sum
@NonNullByDefault
public interface GroupFunction
Group functions are used by active group items to calculate a state for the group
out of the states of all its member items.
- Author:
- Kai Kreuzer - Initial contribution
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
This is the default group function that does nothing else than to check if all member items have the same state. -
Method Summary
Modifier and TypeMethodDescriptionDetermines the current state of a group based on a list of itemsState[]
Returns the parameters of the function as an array.<T extends State>
@Nullable TgetStateAs
(@Nullable Set<Item> items, Class<T> stateClass) Calculates the group state and returns it as a state of the requested type.
-
Method Details
-
calculate
Determines the current state of a group based on a list of items- Parameters:
items
- the items to calculate a group state for- Returns:
- the calculated group state
-
getStateAs
Calculates the group state and returns it as a state of the requested type.- Parameters:
items
- the items to calculate a group state forstateClass
- the type in which the state should be returned- Returns:
- the calculated group state of the requested type or null, if type is not supported
-
getParameters
State[] getParameters()Returns the parameters of the function as an array.- Returns:
- the parameters of this function
-