private boolean isFilter(Query query) {
   return query != null && query.getType().getType().equals(Query.Type.FILTER);
 }
 private boolean isQuery(Query query) {
   return query != null && query.getType().getType().equals(Query.Type.QUERY);
 }