Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Javadocs for set vs add in StructuredQuery's builder #275

Merged
merged 2 commits into from
Oct 21, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ static Filter fromPb(DatastoreV1.Filter filterPb) {
}
}

/*
* A class representing a filter composed of a combination of other filters.
*/
public static final class CompositeFilter extends Filter {

private static final long serialVersionUID = 3610352685739360009L;
Expand Down Expand Up @@ -194,6 +197,9 @@ protected DatastoreV1.Filter toPb() {
}
}

/*
* A class representing a filter based on a single property or ancestor.
*/
public static final class PropertyFilter extends Filter {

private static final long serialVersionUID = -4514695915258598597L;
Expand Down Expand Up @@ -514,6 +520,9 @@ static OrderBy fromPb(DatastoreV1.PropertyOrder propertyOrderPb) {
}
}

/*
* A class representing a projection based on a property.
*/
public static final class Projection implements Serializable {

private static final long serialVersionUID = 3083707957256279470L;
Expand Down Expand Up @@ -665,12 +674,18 @@ public B clearOrderBy() {
return self();
}

/*
* Clears all previously-specified OrderBy objects and orders by the given input instead.

This comment was marked as spam.

*/
public B orderBy(OrderBy orderBy, OrderBy... others) {
clearOrderBy();
addOrderBy(orderBy, others);
return self();
}

/*
* Adds one or more OrderBy objects to the existing list of OrderBy objects.
*/
public B addOrderBy(OrderBy orderBy, OrderBy... others) {
this.orderBy.add(orderBy);
Collections.addAll(this.orderBy, others);
Expand All @@ -682,12 +697,19 @@ B clearProjection() {
return self();
}

/*
* Clears all previously-specified Projections and sets the list of Projections to the given
* input instead.
*/
B projection(Projection projection, Projection... others) {

This comment was marked as spam.

clearProjection();
addProjection(projection, others);
return self();
}

/*
* Adds one or more Projections to the existing list of Projections.
*/
B addProjection(Projection projection, Projection... others) {
this.projection.add(projection);
Collections.addAll(this.projection, others);
Expand All @@ -699,12 +721,19 @@ B clearGroupBy() {
return self();
}

/*
* Clears all existing properties to group by and instead groups by the given the list of
* properties.
*/
B groupBy(String property, String... others) {
clearGroupBy();
addGroupBy(property, others);
return self();
}

/*
* Adds one or more properties to the existing list of "group by" properties.
*/
B addGroupBy(String property, String... others) {
this.groupBy.add(property);
Collections.addAll(this.groupBy, others);
Expand Down Expand Up @@ -754,6 +783,9 @@ static final class Builder<V> extends BaseBuilder<V, Builder<V>> {
}
}

/*
* A StructuredQuery builder for queries that return Entity results.
*/
public static final class EntityQueryBuilder extends BaseBuilder<Entity, EntityQueryBuilder> {

EntityQueryBuilder() {
Expand All @@ -766,6 +798,9 @@ public StructuredQuery<Entity> build() {
}
}

/*
* A StructuredQuery builder for queries that return Key results.
*/
public static final class KeyQueryBuilder extends BaseBuilder<Key, KeyQueryBuilder> {

KeyQueryBuilder() {
Expand All @@ -787,6 +822,9 @@ public StructuredQuery<Key> build() {
}
}

/*
* A StructuredQuery builder for projection queries.
*/
public static final class ProjectionEntityQueryBuilder
extends BaseBuilder<ProjectionEntity, ProjectionEntityQueryBuilder> {

Expand Down