public final class QueryFactory
extends java.lang.Object
Query
instances.
Uses the given ActorRequestFactory
as a source of the query meta information,
such as the actor.
ActorRequestFactory.query()
Modifier and Type | Method and Description |
---|---|
io.spine.client.Query |
all(java.lang.Class<? extends io.spine.base.EntityState> entityClass)
Creates a
Query to read all states of a certain entity. |
io.spine.client.Query |
allWithMask(java.lang.Class<? extends io.spine.base.EntityState> entityClass,
java.lang.String... maskPaths)
Creates a
Query to read all entity states with the FieldMask
applied to each of the results. |
io.spine.client.Query |
byIds(java.lang.Class<? extends io.spine.base.EntityState> entityClass,
java.util.Set<?> ids)
Creates a
Query to read certain entity states by IDs. |
io.spine.client.Query |
byIdsWithMask(java.lang.Class<? extends io.spine.base.EntityState> entityClass,
java.util.Set<?> ids,
java.lang.String... maskPaths)
Creates a
Query to read certain entity states by IDs with the FieldMask
applied to each of the results. |
QueryBuilder |
select(java.lang.Class<? extends io.spine.base.EntityState> targetType)
Creates a new instance of
QueryBuilder for the further Query
construction. |
public QueryBuilder select(java.lang.Class<? extends io.spine.base.EntityState> targetType)
QueryBuilder
for the further Query
construction.targetType
- the query target typeQueryBuilder
public io.spine.client.Query byIdsWithMask(java.lang.Class<? extends io.spine.base.EntityState> entityClass, java.util.Set<?> ids, java.lang.String... maskPaths)
Query
to read certain entity states by IDs with the FieldMask
applied to each of the results.
Allows to specify a set of identifiers to be used during the Query
processing.
The processing results will contain only the entities, which IDs are present among
the ids
.
Allows to set property paths for a FieldMask
applied to each of the query
results. This processing is performed according to the
FieldMask specs.
If the paths
array contains entries inapplicable to the resulting entity
(for example a path
references a missing field),
such invalid paths are silently ignored.
entityClass
- the class of a target entityids
- the IDs of interest of type which is supported as identifier
maskPaths
- the property paths for the FieldMask
applied
to each of the resultsQuery
formed according to the passed parameterspublic io.spine.client.Query byIds(java.lang.Class<? extends io.spine.base.EntityState> entityClass, java.util.Set<?> ids)
Query
to read certain entity states by IDs.
Allows to specify a set of identifiers to be used during the Query
processing.
The processing results will contain only the entities which IDs are present among
the ids
.
Unlike QueryFactory.byIdsWithMask(Class, Set, String...)
, the Query
processing
will not change the resulting entities.
entityClass
- the class of a target entityids
- the IDs of interest of type which is supported as identifier
Query
formed according to the passed parametersjava.lang.IllegalArgumentException
- if any of IDs have invalid type or are null
public io.spine.client.Query allWithMask(java.lang.Class<? extends io.spine.base.EntityState> entityClass, java.lang.String... maskPaths)
Query
to read all entity states with the FieldMask
applied to each of the results.
Allows to set property paths for a FieldMask
, applied to each of the query
results. This processing is performed according to the
FieldMask specs.
If the paths
array contains entries inapplicable to the resulting entity
(e.g. a path
references a missing field), such invalid paths
are silently ignored.
entityClass
- the class of a target entitymaskPaths
- the property paths for the FieldMask
applied to each of the resultsQuery
formed according to the passed parameterspublic io.spine.client.Query all(java.lang.Class<? extends io.spine.base.EntityState> entityClass)
Query
to read all states of a certain entity.
Unlike QueryFactory.allWithMask(Class, String...)
, the Query
processing will
not change the resulting entities.
entityClass
- the class of a target entityQuery
formed according to the passed parameters