Package com.flora.db
Class Query
java.lang.Object
com.flora.db.Query
A class which helps in querying data from the database.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList[]
allList()
Collects all the list stored in the database.Collects all the object (POJO) stored in the database.<T> List<T>[]
whereListContains
(T contains) Collects the list that contain a particular object.<T> List<T>
whereObjectMeets
(Class<T> clazz, Predicate<T> condition) Collects the objects from the database which meet the condition.
-
Constructor Details
-
Query
A map version of the database which contain every data of the database- Parameters:
map
- The database map
-
-
Method Details
-
allList
Collects all the list stored in the database.- Returns:
- Array of list containing every list in the database.
-
allObjects
Collects all the object (POJO) stored in the database.- Returns:
- Array of syncables.
-
whereListContains
Collects the list that contain a particular object.- Type Parameters:
T
- Type of object- Parameters:
contains
- The object that the list contain- Returns:
- A list[] containing matching results.
-
whereObjectMeets
Collects the objects from the database which meet the condition.- Parameters:
clazz
- The type of your objectcondition
- A boolean function returning a condition to filter.- Returns:
- A list of objects of type clazz.
-