public class EntityQuery<E extends Entity> extends java.lang.Object implements Predicate<Entity>
Representation of a query.
newBuilder(EntityType)
Modifier and Type | Method and Description |
---|---|
boolean |
apply(Entity entity)
Call
matches(Entity) . |
EntityType |
getEntityType()
Get the entity type to return.
|
java.util.List<Attribute<?>> |
getFilterFields()
Get the field filters.
|
Ordering<Entity> |
getOrdering()
Get the sort order as an ordering.
|
java.util.List<SortKey> |
getSortKeys()
Get the sort keys.
|
java.lang.Class<E> |
getViewType()
Get the type to view results as.
|
boolean |
matches(Entity entity)
Determine whether this query matches the specified entity.
|
static EntityQueryBuilder |
newBuilder(EntityType type)
Construct a new data query builder.
|
public static EntityQueryBuilder newBuilder(EntityType type)
Construct a new data query builder.
type
- The entity typepublic EntityType getEntityType()
Get the entity type to return.
public java.util.List<Attribute<?>> getFilterFields()
Get the field filters. The results should only include entities matching all queries.
public java.util.List<SortKey> getSortKeys()
Get the sort keys.
public Ordering<Entity> getOrdering()
Get the sort order as an ordering.
public java.lang.Class<E> getViewType()
Get the type to view results as.
public boolean apply(@Nullable Entity entity)
Call matches(Entity)
.
entity
- The entity to match.true
if the entity matches the querypublic boolean matches(Entity entity)
Determine whether this query matches the specified entity.
entity
- The entity to test.