Skip to content

Commit e0cfa4e

Browse files
lycaronksv510
andauthored
[BKNDLSS-25614] Change response for file reference type (#498)
Co-authored-by: Sergey Kukurudzyak <[email protected]>
1 parent 1408567 commit e0cfa4e

File tree

4 files changed

+45
-61
lines changed

4 files changed

+45
-61
lines changed

src/com/backendless/persistence/DataQueryBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ public DataQueryBuilder setRelated( String... related )
204204
return queryOptionsBuilder.setRelated( related );
205205
}
206206

207+
public DataQueryBuilder setFileReferencePrefix( String fileReferencePrefix )
208+
{
209+
return queryOptionsBuilder.setFileReferencePrefix( fileReferencePrefix );
210+
}
211+
207212
public DataQueryBuilder addRelated( List<String> related )
208213
{
209214
return queryOptionsBuilder.addRelated( related );

src/com/backendless/persistence/GroupDataQueryBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ public GroupDataQueryBuilder setRelated( String... related )
218218
return queryOptionsBuilder.setRelated( related );
219219
}
220220

221+
public GroupDataQueryBuilder setFileReferencePrefix( String fileReferencePrefix )
222+
{
223+
return queryOptionsBuilder.setFileReferencePrefix( fileReferencePrefix );
224+
}
225+
221226
public GroupDataQueryBuilder addRelated( List<String> related )
222227
{
223228
return queryOptionsBuilder.addRelated( related );

src/com/backendless/persistence/QueryOptions.java

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,39 @@
1818

1919
package com.backendless.persistence;
2020

21+
import lombok.Getter;
22+
import lombok.NoArgsConstructor;
23+
import lombok.Setter;
24+
2125
import java.util.ArrayList;
2226
import java.util.List;
2327

28+
@NoArgsConstructor
2429
public class QueryOptions
2530
{
26-
private List<String> sortBy = new ArrayList<String>();
27-
private List<String> related = new ArrayList<String>();
31+
@Setter
32+
private List<String> sortBy = new ArrayList<>();
33+
@Setter
34+
private List<String> related = new ArrayList<>();
35+
@Getter @Setter
2836
private Integer relationsDepth;
37+
@Getter @Setter
2938
private Integer relationsPageSize;
30-
31-
public QueryOptions()
32-
{
33-
}
39+
@Getter @Setter
40+
private String fileReferencePrefix;
3441

3542
public QueryOptions( String sortBy )
3643
{
3744
addSortByOption( sortBy );
3845
}
3946

40-
public void setSortBy( List<String> sortBy )
41-
{
42-
this.sortBy = sortBy;
43-
}
44-
45-
public void setRelated( List<String> related )
46-
{
47-
this.related = related;
48-
}
49-
5047
public void addSortByOption( String sortBy )
5148
{
5249
if( sortBy == null || sortBy.equals( "" ) )
5350
return;
5451

5552
if( this.sortBy == null )
56-
this.sortBy = new ArrayList<String>();
53+
this.sortBy = new ArrayList<>();
5754

5855
this.sortBy.add( sortBy );
5956
}
@@ -64,35 +61,25 @@ public void addRelated( String related )
6461
return;
6562

6663
if( this.related == null )
67-
this.related = new ArrayList<String>();
64+
this.related = new ArrayList<>();
6865

6966
this.related.add( related );
7067
}
7168

7269
public List<String> getSortBy()
7370
{
7471
if( sortBy == null )
75-
return sortBy = new ArrayList<String>();
72+
return sortBy = new ArrayList<>();
7673

77-
return new ArrayList<String>( sortBy );
74+
return new ArrayList<>( sortBy );
7875
}
7976

8077
public List<String> getRelated()
8178
{
8279
if( related == null )
83-
return related = new ArrayList<String>();
84-
85-
return new ArrayList<String>( related );
86-
}
87-
88-
public Integer getRelationsPageSize()
89-
{
90-
return relationsPageSize;
91-
}
80+
return related = new ArrayList<>();
9281

93-
public void setRelationsPageSize( Integer relationsPageSize )
94-
{
95-
this.relationsPageSize = relationsPageSize;
82+
return new ArrayList<>( related );
9683
}
9784

9885
public QueryOptions newInstance()
@@ -102,17 +89,8 @@ public QueryOptions newInstance()
10289
result.setRelated( related );
10390
result.setRelationsDepth( relationsDepth );
10491
result.setRelationsPageSize( relationsPageSize );
92+
result.setFileReferencePrefix( fileReferencePrefix );
10593

10694
return result;
10795
}
108-
109-
public void setRelationsDepth ( Integer relationsDepth )
110-
{
111-
this.relationsDepth = relationsDepth;
112-
}
113-
114-
public Integer getRelationsDepth()
115-
{
116-
return relationsDepth;
117-
}
11896
}

src/com/backendless/persistence/QueryOptionsBuilder.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
package com.backendless.persistence;
22

3+
import lombok.Getter;
4+
import lombok.Setter;
5+
36
import java.util.ArrayList;
47
import java.util.Arrays;
58
import java.util.List;
69

710
class QueryOptionsBuilder<Builder>
811
{
12+
@Getter
913
private List<String> sortBy;
14+
@Getter
1015
private List<String> related;
16+
@Getter
1117
private Integer relationsDepth;
18+
@Getter
1219
private Integer relationsPageSize;
20+
@Getter
21+
private String fileReferencePrefix;
1322
private Builder builder;
1423

1524
QueryOptionsBuilder( Builder builder )
@@ -26,16 +35,12 @@ QueryOptions build()
2635
queryOptions.setRelationsDepth( relationsDepth );
2736
queryOptions.setSortBy( sortBy );
2837
queryOptions.setRelationsPageSize( relationsPageSize );
38+
queryOptions.setFileReferencePrefix( fileReferencePrefix );
2939
return queryOptions;
3040
}
3141

3242
/*--- Auto-generated code ---*/
3343

34-
public List<String> getSortBy()
35-
{
36-
return sortBy;
37-
}
38-
3944
public Builder setSortBy( List<String> sortBy )
4045
{
4146
this.sortBy = sortBy;
@@ -54,11 +59,6 @@ public Builder addSortBy( String sortBy )
5459
return builder;
5560
}
5661

57-
public List<String> getRelated()
58-
{
59-
return related;
60-
}
61-
6262
public Builder setRelated( List<String> related )
6363
{
6464
this.related = related;
@@ -83,25 +83,21 @@ public Builder addRelated( String related )
8383
return builder;
8484
}
8585

86-
public Integer getRelationsDepth()
87-
{
88-
return relationsDepth;
89-
}
90-
9186
public Builder setRelationsDepth( Integer relationsDepth )
9287
{
9388
this.relationsDepth = relationsDepth;
9489
return builder;
9590
}
9691

97-
public Integer getRelationsPageSize()
92+
public Builder setRelationsPageSize( Integer relationPageSize )
9893
{
99-
return relationsPageSize;
94+
this.relationsPageSize = relationPageSize;
95+
return builder;
10096
}
10197

102-
public Builder setRelationsPageSize( Integer relationPageSize )
98+
public Builder setFileReferencePrefix( String fileReferencePrefix )
10399
{
104-
this.relationsPageSize = relationPageSize;
100+
this.fileReferencePrefix = fileReferencePrefix;
105101
return builder;
106102
}
107103
}

0 commit comments

Comments
 (0)