Skip to content

Commit 5f01eb9

Browse files
author
Ajay Kannan
committed
add javadocs for set vs add in structured query builder
1 parent 2665ab5 commit 5f01eb9

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/StructuredQuery.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ static Filter fromPb(DatastoreV1.Filter filterPb) {
113113
}
114114
}
115115

116+
/*
117+
* A class representing a filter composed of a combination of other filters.
118+
*/
116119
public static final class CompositeFilter extends Filter {
117120

118121
private static final long serialVersionUID = 3610352685739360009L;
@@ -194,6 +197,9 @@ protected DatastoreV1.Filter toPb() {
194197
}
195198
}
196199

200+
/*
201+
* A class representing a filter based on a single property or ancestor.
202+
*/
197203
public static final class PropertyFilter extends Filter {
198204

199205
private static final long serialVersionUID = -4514695915258598597L;
@@ -514,6 +520,9 @@ static OrderBy fromPb(DatastoreV1.PropertyOrder propertyOrderPb) {
514520
}
515521
}
516522

523+
/*
524+
* A class representing a projection based on a property.
525+
*/
517526
public static final class Projection implements Serializable {
518527

519528
private static final long serialVersionUID = 3083707957256279470L;
@@ -665,12 +674,18 @@ public B clearOrderBy() {
665674
return self();
666675
}
667676

677+
/*
678+
* Clears all previously-specified OrderBy objects and orders by the given input instead.
679+
*/
668680
public B orderBy(OrderBy orderBy, OrderBy... others) {
669681
clearOrderBy();
670682
addOrderBy(orderBy, others);
671683
return self();
672684
}
673685

686+
/*
687+
* Adds one or more OrderBy objects to the existing list of OrderBy objects.
688+
*/
674689
public B addOrderBy(OrderBy orderBy, OrderBy... others) {
675690
this.orderBy.add(orderBy);
676691
Collections.addAll(this.orderBy, others);
@@ -682,12 +697,19 @@ B clearProjection() {
682697
return self();
683698
}
684699

700+
/*
701+
* Clears all previously-specified Projections and sets the list of Projections to the given
702+
* input instead.
703+
*/
685704
B projection(Projection projection, Projection... others) {
686705
clearProjection();
687706
addProjection(projection, others);
688707
return self();
689708
}
690709

710+
/*
711+
* Adds one or more Projections to the existing list of Projections.
712+
*/
691713
B addProjection(Projection projection, Projection... others) {
692714
this.projection.add(projection);
693715
Collections.addAll(this.projection, others);
@@ -699,12 +721,19 @@ B clearGroupBy() {
699721
return self();
700722
}
701723

724+
/*
725+
* Clears all existing properties to group by and instead groups by the given the list of
726+
* properties.
727+
*/
702728
B groupBy(String property, String... others) {
703729
clearGroupBy();
704730
addGroupBy(property, others);
705731
return self();
706732
}
707733

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

786+
/*
787+
* A StructuredQuery builder for queries that return Entity results.
788+
*/
757789
public static final class EntityQueryBuilder extends BaseBuilder<Entity, EntityQueryBuilder> {
758790

759791
EntityQueryBuilder() {
@@ -766,6 +798,9 @@ public StructuredQuery<Entity> build() {
766798
}
767799
}
768800

801+
/*
802+
* A StructuredQuery builder for queries that return Key results.
803+
*/
769804
public static final class KeyQueryBuilder extends BaseBuilder<Key, KeyQueryBuilder> {
770805

771806
KeyQueryBuilder() {
@@ -787,6 +822,9 @@ public StructuredQuery<Key> build() {
787822
}
788823
}
789824

825+
/*
826+
* A StructuredQuery builder for projection queries.
827+
*/
790828
public static final class ProjectionEntityQueryBuilder
791829
extends BaseBuilder<ProjectionEntity, ProjectionEntityQueryBuilder> {
792830

0 commit comments

Comments
 (0)