Package com.flora.db

Class Query

java.lang.Object
com.flora.db.Query

public class Query extends Object
A class which helps in querying data from the database.
  • Constructor Details

    • Query

      public Query(Map<String,Object> map)
      A map version of the database which contain every data of the database
      Parameters:
      map - The database map
  • Method Details

    • allList

      public List[] allList()
      Collects all the list stored in the database.
      Returns:
      Array of list containing every list in the database.
    • allObjects

      public <T extends Syncable> Syncable[] allObjects()
      Collects all the object (POJO) stored in the database.
      Returns:
      Array of syncables.
    • whereListContains

      public <T> List<T>[] whereListContains(T contains)
      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

      public <T> List<T> whereObjectMeets(Class<T> clazz, Predicate<T> condition)
      Collects the objects from the database which meet the condition.
      Parameters:
      clazz - The type of your object
      condition - A boolean function returning a condition to filter.
      Returns:
      A list of objects of type clazz.