Package org.openhab.core.persistence
Class FilterCriteria
java.lang.Object
org.openhab.core.persistence.FilterCriteria
This class is used to define a filter for queries to a
PersistenceService.
It is designed as a Java bean, for which the different properties are constraints on the query result. These
properties include the item name, begin and end date and the item state. A compare operator can be defined to compare
not only state equality, but also its decimal value (<,>).
Additionally, the filter criteria supports ordering and paging of the result, so the caller can ask to only return chunks of the result of a certain size (=pageSize) from a starting index (pageNumber*pageSize).
All setter methods return the filter criteria instance, so that the methods can be easily chained in order to define a filter.
- Author:
- Kai Kreuzer - Initial contribution, Lyubomir Papazov - Deprecate methods using java.util and add methods that use Java8's ZonedDateTime, Mark Herwege - Copy constructor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration with all possible compare optionsstatic enumEnumeration with all ordering options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ZonedDateTime@Nullable ZonedDateTime@Nullable Stringintint@Nullable StategetState()setBeginDate(ZonedDateTime beginDate) setEndDate(ZonedDateTime endDate) setItemName(String itemName) setOperator(FilterCriteria.Operator operator) setOrdering(FilterCriteria.Ordering ordering) setPageNumber(int pageNumber) setPageSize(int pageSize) toString()
-
Constructor Details
-
FilterCriteria
public FilterCriteria() -
FilterCriteria
-
-
Method Details