• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smartsheet / smartsheet-java-sdk / #55

02 Oct 2024 07:40PM UTC coverage: 60.548% (+0.7%) from 59.836%
#55

push

github

web-flow
Release prep for 3.2.1 (#103)

4156 of 6864 relevant lines covered (60.55%)

0.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.95
/src/main/java/com/smartsheet/api/models/Row.java
1
/*
2
 * Copyright (C) 2024 Smartsheet
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.smartsheet.api.models;
18

19
import com.smartsheet.api.models.format.Format;
20

21
import java.util.List;
22

23
/**
24
 * Represents the Row object.
25
 */
26
public class Row extends AbstractRow<Column, Cell> {
27

28
    /**
29
     * Default constructor
30
     */
31
    public Row() {
1✔
32
    }
1✔
33

34
    /**
35
     * Construct a Row with specified id
36
     *
37
     * @param id Row id
38
     */
39
    public Row(Long id) {
1✔
40
        this.setId(id);
1✔
41
    }
1✔
42

43
    /**
44
     * A convenience class for creating a {@link RowWrapper} with the necessary fields for inserting a {@link Row} or
45
     * set of rows.
46
     */
47
    public static class AddRowBuilder {
1✔
48
        private Boolean toTop;
49
        private Boolean toBottom;
50
        private Long parentId;
51
        private Long siblingId;
52
        private Boolean above;
53
        private Format format;
54
        private Boolean expanded;
55
        private List<Cell> cells;
56

57
        /**
58
         * Gets the to top.
59
         *
60
         * @return the to top
61
         */
62
        public Boolean getToTop() {
63
            return toTop;
×
64
        }
65

66
        /**
67
         * Sets the to top flag that puts the row at the top of the sheet.
68
         *
69
         * @param toTop the to top flag
70
         * @return the insert rows builder
71
         */
72
        public AddRowBuilder setToTop(Boolean toTop) {
73
            this.toTop = toTop;
1✔
74
            return this;
1✔
75
        }
76

77
        /**
78
         * Gets the to bottom.
79
         *
80
         * @return the to bottom
81
         */
82
        public Boolean getToBottom() {
83
            return toBottom;
×
84
        }
85

86
        /**
87
         * Sets the to bottom flag that puts the row at the bottom of the sheet.
88
         *
89
         * @param toBottom the to bottom
90
         * @return the insert rows builder
91
         */
92
        public AddRowBuilder setToBottom(Boolean toBottom) {
93
            this.toBottom = toBottom;
×
94
            return this;
×
95
        }
96

97
        /**
98
         * Gets the parent id.
99
         *
100
         * @return the parent id
101
         */
102
        public Long getParentId() {
103
            return parentId;
×
104
        }
105

106
        /**
107
         * Sets the parent id that puts the row as the first child of the specified id.
108
         *
109
         * @param parentId the parent id
110
         * @return the insert rows builder
111
         */
112
        public AddRowBuilder setParentId(Long parentId) {
113
            this.parentId = parentId;
×
114
            return this;
×
115
        }
116

117
        /**
118
         * Gets the sibling id.
119
         *
120
         * @return the sibling id
121
         */
122
        public Long getSiblingId() {
123
            return siblingId;
×
124
        }
125

126
        /**
127
         * Sets the sibling id that puts the row as the next row at the same hierarchical level of this row.
128
         *
129
         * @param siblingId the sibling id
130
         * @return the insert rows builder
131
         */
132
        public AddRowBuilder setSiblingId(Long siblingId) {
133
            this.siblingId = siblingId;
×
134
            return this;
×
135
        }
136

137
        /**
138
         * Gets the above flag
139
         *
140
         * @return the above flag
141
         */
142
        public Boolean getAbove() {
143
            return above;
×
144
        }
145

146
        /**
147
         * Sets the above flag
148
         *
149
         * @param above the above flag
150
         * @return the insert rows builder
151
         */
152
        public AddRowBuilder setAbove(Boolean above) {
153
            this.above = above;
×
154
            return this;
×
155
        }
156

157
        /**
158
         * Gets the format
159
         *
160
         * @return the format
161
         */
162
        public Format getFormat() {
163
            return format;
×
164
        }
165

166
        /**
167
         * Sets the format
168
         *
169
         * @param format the format
170
         * @return the insert rows builder
171
         */
172
        public AddRowBuilder setFormat(Format format) {
173
            this.format = format;
1✔
174
            return this;
1✔
175
        }
176

177
        /**
178
         * Gets the expanded flag
179
         *
180
         * @return the expanded flag
181
         */
182
        public Boolean getExpanded() {
183
            return expanded;
×
184
        }
185

186
        /**
187
         * Sets the expanded flag
188
         *
189
         * @param expanded the expanded flag
190
         * @return the insert rows builder
191
         */
192
        public AddRowBuilder setExpanded(Boolean expanded) {
193
            this.expanded = expanded;
1✔
194
            return this;
1✔
195
        }
196

197
        /**
198
         * Gets the list of cells
199
         *
200
         * @return the list of cells
201
         */
202
        public List<Cell> getCells() {
203
            return cells;
×
204
        }
205

206
        /**
207
         * Sets the list of cells
208
         *
209
         * @param cells the list of cells
210
         * @return the insert rows builder
211
         */
212
        public AddRowBuilder setCells(List<Cell> cells) {
213
            this.cells = cells;
1✔
214
            return this;
1✔
215
        }
216

217
        /**
218
         * Builds the row object
219
         *
220
         * @return the row object
221
         */
222
        public Row build() {
223
            Row row = new Row();
1✔
224
            row.setToTop(toTop);
1✔
225
            row.setToBottom(toBottom);
1✔
226
            row.setParentId(parentId);
1✔
227
            row.setSiblingId(siblingId);
1✔
228
            row.setAbove(above);
1✔
229
            row.setFormat(format);
1✔
230
            row.setExpanded(expanded);
1✔
231
            row.setCells(cells);
1✔
232
            return row;
1✔
233
        }
234
    }
235

236
    public static class UpdateRowBuilder {
1✔
237
        private Boolean toTop;
238
        private Boolean toBottom;
239
        private Long parentId;
240
        private Long siblingId;
241
        private Boolean above;
242
        private Integer indent;
243
        private Integer outdent;
244
        private Format format;
245
        private Boolean expanded;
246
        private List<Cell> cells;
247
        private Boolean locked;
248
        private Long id;
249

250
        public Long getRowId() {
251
            return id;
1✔
252
        }
253

254
        /**
255
         * Set the Row ID
256
         */
257
        public UpdateRowBuilder setRowId(Long rowId) {
258
            this.id = rowId;
×
259
            return this;
×
260
        }
261

262
        /**
263
         * Gets the to top.
264
         *
265
         * @return the to top
266
         */
267
        public Boolean getToTop() {
268
            return toTop;
×
269
        }
270

271
        /**
272
         * Sets the to top flag that puts the row at the top of the sheet.
273
         *
274
         * @param toTop the to top flag
275
         * @return the update rows builder
276
         */
277
        public UpdateRowBuilder setToTop(Boolean toTop) {
278
            this.toTop = toTop;
1✔
279
            return this;
1✔
280
        }
281

282
        /**
283
         * Gets the to bottom.
284
         *
285
         * @return the to bottom
286
         */
287
        public Boolean getToBottom() {
288
            return toBottom;
×
289
        }
290

291
        /**
292
         * Sets the to bottom flag that puts the row at the bottom of the sheet.
293
         *
294
         * @param toBottom the to bottom
295
         * @return the update rows builder
296
         */
297
        public UpdateRowBuilder setToBottom(Boolean toBottom) {
298
            this.toBottom = toBottom;
×
299
            return this;
×
300
        }
301

302
        /**
303
         * Gets the parent id.
304
         *
305
         * @return the parent id
306
         */
307
        public Long getParentId() {
308
            return parentId;
×
309
        }
310

311
        /**
312
         * Sets the parent id that puts the row as the first child of the specified id.
313
         *
314
         * @param parentId the parent id
315
         * @return the update rows builder
316
         */
317
        public UpdateRowBuilder setParentId(Long parentId) {
318
            this.parentId = parentId;
×
319
            return this;
×
320
        }
321

322
        /**
323
         * Gets the sibling id.
324
         *
325
         * @return the sibling id
326
         */
327
        public Long getSiblingId() {
328
            return siblingId;
×
329
        }
330

331
        /**
332
         * Sets the sibling id that puts the row as the next row at the same hierarchical level of this row.
333
         *
334
         * @param siblingId the sibling id
335
         * @return the update rows builder
336
         */
337
        public UpdateRowBuilder setSiblingId(Long siblingId) {
338
            this.siblingId = siblingId;
×
339
            return this;
×
340
        }
341

342
        /**
343
         * Gets the above flag
344
         *
345
         * @return the above flag
346
         */
347
        public Boolean getAbove() {
348
            return above;
×
349
        }
350

351
        /**
352
         * Sets the above flag
353
         *
354
         * @param above the above flag
355
         * @return the insert rows builder
356
         */
357
        public UpdateRowBuilder setAbove(Boolean above) {
358
            this.above = above;
×
359
            return this;
×
360
        }
361

362
        /**
363
         * Gets the number of levels of indent
364
         *
365
         * @return the number of levels of indent
366
         */
367
        public Integer getIndent() {
368
            return indent;
×
369
        }
370

371
        /**
372
         * Sets the number of levels of indent
373
         *
374
         * @param indent number of levels of indent
375
         * @return the update rows builder
376
         */
377
        public UpdateRowBuilder setIndent(Integer indent) {
378
            this.indent = indent;
×
379
            return this;
×
380
        }
381

382
        /**
383
         * Gets the number of levels of outdent
384
         *
385
         * @return the number of levels of outdent
386
         */
387
        public Integer getOutdent() {
388
            return outdent;
×
389
        }
390

391
        /**
392
         * Sets the number of levels of outdent
393
         *
394
         * @param outdent number of levels of outdent
395
         * @return the update rows builder
396
         */
397
        public UpdateRowBuilder setOutdent(Integer outdent) {
398
            this.outdent = outdent;
×
399
            return this;
×
400
        }
401

402
        /**
403
         * Gets the format
404
         *
405
         * @return the format
406
         */
407
        public Format getFormat() {
408
            return format;
×
409
        }
410

411
        /**
412
         * Sets the format
413
         *
414
         * @param format the format
415
         * @return the update rows builder
416
         */
417
        public UpdateRowBuilder setFormat(Format format) {
418
            this.format = format;
1✔
419
            return this;
1✔
420
        }
421

422
        /**
423
         * Gets the expanded flag
424
         *
425
         * @return the expanded flag
426
         */
427
        public Boolean getExpanded() {
428
            return expanded;
×
429
        }
430

431
        /**
432
         * Sets the expanded flag
433
         *
434
         * @param expanded the expanded flag
435
         * @return the update rows builder
436
         */
437
        public UpdateRowBuilder setExpanded(Boolean expanded) {
438
            this.expanded = expanded;
1✔
439
            return this;
1✔
440
        }
441

442
        /**
443
         * Gets the list of cells
444
         *
445
         * @return the list of cells
446
         */
447
        public List<Cell> getCells() {
448
            return cells;
×
449
        }
450

451
        /**
452
         * Sets the list of cells
453
         *
454
         * @param cells the list of cells
455
         * @return the update rows builder
456
         */
457
        public UpdateRowBuilder setCells(List<Cell> cells) {
458
            this.cells = cells;
1✔
459
            return this;
1✔
460
        }
461

462
        /**
463
         * Gets the locked flag
464
         *
465
         * @return the locked flag
466
         */
467
        public Boolean getLocked() {
468
            return locked;
×
469
        }
470

471
        /**
472
         * Sets the locked flag
473
         *
474
         * @param locked the locked flag
475
         * @return the update rows builder
476
         */
477
        public UpdateRowBuilder setLocked(Boolean locked) {
478
            this.locked = locked;
1✔
479
            return this;
1✔
480
        }
481

482
        /**
483
         * Builds the row object
484
         *
485
         * @return the row object
486
         */
487
        public Row build() {
488
            Row row = new Row();
1✔
489
            row.setToTop(toTop);
1✔
490
            row.setToBottom(toBottom);
1✔
491
            row.setParentId(parentId);
1✔
492
            row.setSiblingId(siblingId);
1✔
493
            row.setAbove(above);
1✔
494
            row.setIndent(indent);
1✔
495
            row.setOutdent(outdent);
1✔
496
            row.setFormat(format);
1✔
497
            row.setExpanded(expanded);
1✔
498
            row.setCells(cells);
1✔
499
            row.setLocked(locked);
1✔
500
            row.setId(getRowId());
1✔
501
            return row;
1✔
502
        }
503
    }
504

505
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc