use of com.google.protobuf.FieldMask in project core-java by SpineEventEngine.
the class QueryFactory method allWithMask.
/**
* Creates a {@link Query} to read all entity states with the {@link FieldMask}
* applied to each of the results.
*
* <p>Allows to set property paths for a {@link FieldMask}, applied to each of the query
* results. This processing is performed according to the
* <a href="https://goo.gl/tW5wIU">FieldMask specs</a>.
*
* <p>In case the {@code paths} array contains entries inapplicable to the resulting entity
* (e.g. a {@code path} references a missing field), such invalid paths
* are silently ignored.
*
* @param entityClass the class of a target entity
* @param maskPaths the property paths for the {@code FieldMask} applied
* to each of results
* @return an instance of {@code Query} formed according to the passed parameters
*/
public Query allWithMask(Class<? extends Message> entityClass, String... maskPaths) {
final FieldMask fieldMask = FieldMask.newBuilder().addAllPaths(Arrays.asList(maskPaths)).build();
final Query result = composeQuery(entityClass, null, null, fieldMask);
return result;
}
Aggregations