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

smartsheet / smartsheet-java-sdk / #43

24 Aug 2023 10:26PM UTC coverage: 50.427% (-0.02%) from 50.442%
#43

push

github-actions

web-flow
Fix Checkstyle violations in api/models Classes (#57)

This will fix ~900 violations

189 of 189 new or added lines in 59 files covered. (100.0%)

3423 of 6788 relevant lines covered (50.43%)

0.5 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
package com.smartsheet.api.models;
2

3
/*
4
 * #[license]
5
 * Smartsheet SDK for Java
6
 * %%
7
 * Copyright (C) 2023 Smartsheet
8
 * %%
9
 * Licensed under the Apache License, Version 2.0 (the "License");
10
 * you may not use this file except in compliance with the License.
11
 * You may obtain a copy of the License at
12
 *
13
 *      http://www.apache.org/licenses/LICENSE-2.0
14
 *
15
 * Unless required by applicable law or agreed to in writing, software
16
 * distributed under the License is distributed on an "AS IS" BASIS,
17
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
 * See the License for the specific language governing permissions and
19
 * limitations under the License.
20
 * %[license]
21
 */
22

23
import com.smartsheet.api.models.format.Format;
24

25
import java.util.List;
26

27
/**
28
 * Represents the Row object.
29
 */
30
public class Row extends AbstractRow<Column, Cell> {
31

32
    /**
33
     * Default constructor
34
     */
35
    public Row() {
1✔
36
    }
1✔
37

38
    /**
39
     * Construct a Row with specified id
40
     *
41
     * @param id Row id
42
     */
43
    public Row(Long id) {
1✔
44
        this.setId(id);
1✔
45
    }
1✔
46

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

61
        /**
62
         * Gets the to top.
63
         *
64
         * @return the to top
65
         */
66
        public Boolean getToTop() {
67
            return toTop;
×
68
        }
69

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

81
        /**
82
         * Gets the to bottom.
83
         *
84
         * @return the to bottom
85
         */
86
        public Boolean getToBottom() {
87
            return toBottom;
×
88
        }
89

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

101
        /**
102
         * Gets the parent id.
103
         *
104
         * @return the parent id
105
         */
106
        public Long getParentId() {
107
            return parentId;
×
108
        }
109

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

121
        /**
122
         * Gets the sibling id.
123
         *
124
         * @return the sibling id
125
         */
126
        public Long getSiblingId() {
127
            return siblingId;
×
128
        }
129

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

141
        /**
142
         * Gets the above flag
143
         * @return the above flag
144
         */
145
        public Boolean getAbove() {
146
            return above;
×
147
        }
148

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

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

167
        /**
168
         * Sets the format
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
         * @return the expanded flag
180
         */
181
        public Boolean getExpanded() {
182
            return expanded;
×
183
        }
184

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

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

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

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

231
    public static class UpdateRowBuilder {
1✔
232
        private Boolean toTop;
233
        private Boolean toBottom;
234
        private Long parentId;
235
        private Long siblingId;
236
        private Boolean above;
237
        private Integer indent;
238
        private Integer outdent;
239
        private Format format;
240
        private Boolean expanded;
241
        private List<Cell> cells;
242
        private Boolean locked;
243
        private Long id;
244

245
        public Long getRowId() {
246
            return id;
1✔
247
        }
248

249
        /**
250
         * Set the Row ID
251
         */
252
        public UpdateRowBuilder setRowId(Long rowId) {
253
            this.id = rowId;
×
254
            return this;
×
255
        }
256

257
        /**
258
         * Gets the to top.
259
         *
260
         * @return the to top
261
         */
262
        public Boolean getToTop() {
263
            return toTop;
×
264
        }
265

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

277
        /**
278
         * Gets the to bottom.
279
         *
280
         * @return the to bottom
281
         */
282
        public Boolean getToBottom() {
283
            return toBottom;
×
284
        }
285

286
        /**
287
         * Sets the to bottom flag that puts the row at the bottom of the sheet.
288
         *
289
         * @param toBottom the to bottom
290
         * @return the update rows builder
291
         */
292
        public UpdateRowBuilder setToBottom(Boolean toBottom) {
293
            this.toBottom = toBottom;
×
294
            return this;
×
295
        }
296

297
        /**
298
         * Gets the parent id.
299
         *
300
         * @return the parent id
301
         */
302
        public Long getParentId() {
303
            return parentId;
×
304
        }
305

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

317
        /**
318
         * Gets the sibling id.
319
         *
320
         * @return the sibling id
321
         */
322
        public Long getSiblingId() {
323
            return siblingId;
×
324
        }
325

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

337
        /**
338
         * Gets the above flag
339
         * @return the above flag
340
         */
341
        public Boolean getAbove() {
342
            return above;
×
343
        }
344

345
        /**
346
         * Sets the above flag
347
         * @param above the above flag
348
         * @return the insert rows builder
349
         */
350
        public UpdateRowBuilder setAbove(Boolean above) {
351
            this.above = above;
×
352
            return this;
×
353
        }
354

355
        /**
356
         * Gets the number of levels of indent
357
         * @return the number of levels of indent
358
         */
359
        public Integer getIndent() {
360
            return indent;
×
361
        }
362

363
        /**
364
         * Sets the number of levels of indent
365
         * @param indent number of levels of indent
366
         * @return the update rows builder
367
         */
368
        public UpdateRowBuilder setIndent(Integer indent) {
369
            this.indent = indent;
×
370
            return this;
×
371
        }
372

373
        /**
374
         * Gets the number of levels of outdent
375
         * @return the number of levels of outdent
376
         */
377
        public Integer getOutdent() {
378
            return outdent;
×
379
        }
380

381
        /**
382
         * Sets the number of levels of outdent
383
         * @param outdent number of levels of outdent
384
         * @return the update rows builder
385
         */
386
        public UpdateRowBuilder setOutdent(Integer outdent) {
387
            this.outdent = outdent;
×
388
            return this;
×
389
        }
390

391
        /**
392
         * Gets the format
393
         * @return the format
394
         */
395
        public Format getFormat() {
396
            return format;
×
397
        }
398

399
        /**
400
         * Sets the format
401
         * @param format the format
402
         * @return the update rows builder
403
         */
404
        public UpdateRowBuilder setFormat(Format format) {
405
            this.format = format;
1✔
406
            return this;
1✔
407
        }
408

409
        /**
410
         * Gets the expanded flag
411
         * @return the expanded flag
412
         */
413
        public Boolean getExpanded() {
414
            return expanded;
×
415
        }
416

417
        /**
418
         * Sets the expanded flag
419
         * @param expanded the expanded flag
420
         * @return the update rows builder
421
         */
422
        public UpdateRowBuilder setExpanded(Boolean expanded) {
423
            this.expanded = expanded;
1✔
424
            return this;
1✔
425
        }
426

427
        /**
428
         * Gets the list of cells
429
         * @return the list of cells
430
         */
431
        public List<Cell> getCells() {
432
            return cells;
×
433
        }
434

435
        /**
436
         * Sets the list of cells
437
         * @param cells the list of cells
438
         * @return the update rows builder
439
         */
440
        public UpdateRowBuilder setCells(List<Cell> cells) {
441
            this.cells = cells;
1✔
442
            return this;
1✔
443
        }
444

445
        /**
446
         * Gets the locked flag
447
         * @return the locked flag
448
         */
449
        public Boolean getLocked() {
450
            return locked;
×
451
        }
452

453
        /**
454
         * Sets the locked flag
455
         * @param locked the locked flag
456
         * @return the update rows builder
457
         */
458
        public UpdateRowBuilder setLocked(Boolean locked) {
459
            this.locked = locked;
1✔
460
            return this;
1✔
461
        }
462

463
        /**
464
         * Builds the row object
465
         * @return the row object
466
         */
467
        public Row build() {
468
            Row row = new Row();
1✔
469
            row.setToTop(toTop);
1✔
470
            row.setToBottom(toBottom);
1✔
471
            row.setParentId(parentId);
1✔
472
            row.setSiblingId(siblingId);
1✔
473
            row.setAbove(above);
1✔
474
            row.setIndent(indent);
1✔
475
            row.setOutdent(outdent);
1✔
476
            row.setFormat(format);
1✔
477
            row.setExpanded(expanded);
1✔
478
            row.setCells(cells);
1✔
479
            row.setLocked(locked);
1✔
480
            row.setId(getRowId());
1✔
481
            return row;
1✔
482
        }
483
    }
484

485
}
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

© 2026 Coveralls, Inc