• 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

62.07
/src/main/java/com/smartsheet/api/models/Attachment.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.enums.AttachmentParentType;
24
import com.smartsheet.api.models.enums.AttachmentSubType;
25
import com.smartsheet.api.models.enums.AttachmentType;
26

27
import java.util.Date;
28

29
/**
30
 * Represents the Attachment object.
31
 * @see <a href="http://help.smartsheet.com/customer/portal/articles/518408-uploading-attachments">Help Uploading
32
 * Attachments</a>
33
 */
34
public class Attachment extends NamedModel<Long> {
1✔
35

36
    /**
37
     * Represents the URL.
38
     */
39
    private String url;
40

41
    /**
42
     * Represents the URL expiration time.
43
     */
44
    private Long urlExpiresInMillis;
45

46
    /**
47
     * Represents the attachment type.
48
     */
49
    private AttachmentType attachmentType;
50

51
    /**
52
     * Represents the attachment sub type.
53
     */
54
    private AttachmentSubType attachmentSubType;
55

56
    /**
57
     * Represents the creation timestamp.
58
     */
59
    private Date createdAt;
60

61
    /**
62
     * Represents the MIME type.
63
     */
64
    private String mimeType;
65

66
    /**
67
     * Represents the parent type.
68
     */
69
    private AttachmentParentType parentType;
70

71
    /**
72
     * Represents the parent ID.
73
     */
74
    private Long parentId;
75

76
    /**
77
     * Represents the attachment size.
78
     */
79
    private Long sizeInKb;
80

81
    /**
82
     * The user who created the attachment.
83
     */
84
    private User createdBy;
85

86
    /**
87
     * Represents the attachment description
88
     */
89
    private String description;
90

91
    /**
92
     * Provide an 'override' of setName (returns Attachment not NamedModel)
93
     *
94
     * @param name the new name
95
     */
96
    public Attachment setName(String name) {
97
        super.setName(name);
1✔
98
        return this;
1✔
99
    }
100

101
    /**
102
     * Gets the URL.
103
     *
104
     * @return The url.
105
     */
106
    public String getUrl() {
107
        return url;
1✔
108
    }
109

110
    /**
111
     * Sets the URL.
112
     *
113
     * @param url the new url
114
     */
115
    public Attachment setUrl(String url) {
116
        this.url = url;
1✔
117
        return this;
1✔
118
    }
119

120
    /**
121
     * Gets the url expires in millis.
122
     *
123
     * @return the url expires in millis
124
     */
125
    public Long getUrlExpiresInMillis() {
126
        return urlExpiresInMillis;
1✔
127
    }
128

129
    /**
130
     * Sets the url expires in millis.
131
     *
132
     * @param urlExpiresInMillis
133
     *            the new url expires in millis
134
     */
135
    public Attachment setUrlExpiresInMillis(Long urlExpiresInMillis) {
136
        this.urlExpiresInMillis = urlExpiresInMillis;
1✔
137
        return this;
1✔
138
    }
139

140
    /**
141
     * Gets the attachment type.
142
     *
143
     * @return the attachment type
144
     */
145
    public AttachmentType getAttachmentType() {
146
        return attachmentType;
1✔
147
    }
148

149
    /**
150
     * Sets the attachment type.
151
     *
152
     * @param attachmentType
153
     *            the new attachment type
154
     */
155
    public Attachment setAttachmentType(AttachmentType attachmentType) {
156
        this.attachmentType = attachmentType;
1✔
157
        return this;
1✔
158
    }
159

160
    /**
161
     * Gets the attachment sub type.
162
     *
163
     * @return the attachment sub type
164
     */
165
    public AttachmentSubType getAttachmentSubType() {
166
        return attachmentSubType;
1✔
167
    }
168

169
    /**
170
     * Sets the attachment sub type.
171
     *
172
     * @param attachmentSubType
173
     *            the new attachment sub type
174
     */
175
    public Attachment setAttachmentSubType(AttachmentSubType attachmentSubType) {
176
        this.attachmentSubType = attachmentSubType;
1✔
177
        return this;
1✔
178
    }
179

180
    /**
181
     * Gets the created at.
182
     *
183
     * @return the created at
184
     */
185
    public Date getCreatedAt() {
186
        return createdAt;
1✔
187
    }
188

189
    /**
190
     * Sets the created at.
191
     *
192
     * @param createdAt
193
     *            the new created at
194
     */
195
    public Attachment setCreatedAt(Date createdAt) {
196
        this.createdAt = createdAt;
1✔
197
        return this;
1✔
198
    }
199

200
    /**
201
     * Gets the mime type.
202
     *
203
     * @return the mime type
204
     */
205
    public String getMimeType() {
206
        return mimeType;
1✔
207
    }
208

209
    /**
210
     * Sets the mime type.
211
     *
212
     * @param mimeType
213
     *            the new mime type
214
     */
215
    public Attachment setMimeType(String mimeType) {
216
        this.mimeType = mimeType;
1✔
217
        return this;
1✔
218
    }
219

220
    /**
221
     * Gets the parent type.
222
     *
223
     * @return the parent type
224
     */
225
    public AttachmentParentType getParentType() {
226
        return parentType;
1✔
227
    }
228

229
    /**
230
     * Sets the parent type.
231
     *
232
     * @param parentType
233
     *            the new parent type
234
     */
235
    public Attachment setParentType(AttachmentParentType parentType) {
236
        this.parentType = parentType;
1✔
237
        return this;
1✔
238
    }
239

240
    /**
241
     * Gets the parent id.
242
     *
243
     * @return the parent id
244
     */
245
    public Long getParentId() {
246
        return parentId;
1✔
247
    }
248

249
    /**
250
     * Sets the parent id.
251
     *
252
     * @param parentId
253
     *            the new parent id
254
     */
255
    public Attachment setParentId(Long parentId) {
256
        this.parentId = parentId;
1✔
257
        return this;
1✔
258
    }
259

260
    /**
261
     * Gets the size in kb.
262
     *
263
     * @return the size in kb
264
     */
265
    public Long getSizeInKb() {
266
        return sizeInKb;
1✔
267
    }
268

269
    /**
270
     * Sets the size in kb.
271
     *
272
     * @param sizeInKb
273
     *            the new size in kb
274
     */
275
    public Attachment setSizeInKb(Long sizeInKb) {
276
        this.sizeInKb = sizeInKb;
1✔
277
        return this;
1✔
278
    }
279

280
    /**
281
     * @return the createdBy
282
     */
283
    public User getCreatedBy() {
284
        return createdBy;
1✔
285
    }
286

287
    /**
288
     * @param createdBy the createdBy to set
289
     */
290
    public Attachment setCreatedBy(User createdBy) {
291
        this.createdBy = createdBy;
1✔
292
        return this;
1✔
293
    }
294

295
    /**
296
     * Gets the attachment description.
297
     *
298
     * @return the attachment description.
299
     */
300
    public String getDescription() {
301
        return description;
1✔
302
    }
303

304
    /**
305
     * Sets the attachment description.
306
     *
307
     * @param description the description
308
     *
309
     */
310
    public Attachment setDescription(String description) {
311
        this.description = description;
1✔
312
        return this;
1✔
313
    }
314

315
    /**
316
     * A convenience class for quickly creating a List of cells to update.
317
     */
318
    public static class CreateAttachmentBuilder {
×
319

320
        /**
321
         * Represents the URL.
322
         */
323
        private String url;
324

325
        /**
326
         * Represents the attachment type.
327
         */
328
        private AttachmentType attachmentType;
329

330
        /**
331
         * Represents the attachment sub type.
332
         */
333
        private AttachmentSubType attachmentSubType;
334

335
        /**
336
         * Represents the attachment description
337
         */
338
        private String description;
339

340
        /**
341
         * Represents the attachment name
342
         */
343
        private String name;
344

345
        /**
346
         * Gets the name.
347
         *
348
         * @return The name.
349
         */
350
        public String getName() {
351
            return name;
×
352
        }
353

354
        /**
355
         * Sets the name.
356
         *
357
         * @param name the new name
358
         * @return the builder object
359
         *
360
         */
361
        public CreateAttachmentBuilder setName(String name) {
362
            this.name = name;
×
363
            return this;
×
364
        }
365

366
        /**
367
         * Gets the URL.
368
         *
369
         * @return The url.
370
         */
371
        public String getUrl() {
372
            return url;
×
373
        }
374

375
        /**
376
         * Sets the URL.
377
         *
378
         * @param url the new url
379
         * @return the builder object
380
         *
381
         */
382
        public CreateAttachmentBuilder setUrl(String url) {
383
            this.url = url;
×
384
            return this;
×
385
        }
386

387
        /**
388
         * Gets the attachment type.
389
         *
390
         * @return the attachment type
391
         */
392
        public AttachmentType getAttachmentType() {
393
            return attachmentType;
×
394
        }
395

396
        /**
397
         * Sets the attachment type.
398
         *
399
         * @param attachmentType
400
         *            the new attachment type
401
         * @return the builder object
402
         */
403
        public CreateAttachmentBuilder setAttachmentType(AttachmentType attachmentType) {
404
            this.attachmentType = attachmentType;
×
405
            return this;
×
406
        }
407

408
        /**
409
         * Gets the attachment sub type.
410
         *
411
         * @return the attachment sub type
412
         */
413
        public AttachmentSubType getAttachmentSubType() {
414
            return attachmentSubType;
×
415
        }
416

417
        /**
418
         * Sets the attachment sub type.
419
         *
420
         * @param attachmentSubType
421
         *            the new attachment sub type
422
         * @return the builder object
423
         */
424
        public CreateAttachmentBuilder setAttachmentSubType(AttachmentSubType attachmentSubType) {
425
            this.attachmentSubType = attachmentSubType;
×
426
            return this;
×
427
        }
428

429
        /**
430
         * Gets the attachment description.
431
         *
432
         * @return the attachment description.
433
         */
434
        public String getDescription() {
435
            return description;
×
436
        }
437

438
        /**
439
         * Sets the attachment description.
440
         *
441
         * @param description the description
442
         * @return the builder object
443
         */
444
        public CreateAttachmentBuilder setDescription(String description) {
445
            this.description = description;
×
446
            return this;
×
447
        }
448

449
        /**
450
         * Returns the list of cells.
451
         *
452
         * @return the list
453
         */
454
        public Attachment build() {
455
            Attachment attachment = new Attachment();
×
456
            attachment.attachmentSubType = attachmentSubType;
×
457
            attachment.attachmentType = attachmentType;
×
458
            attachment.description = description;
×
459
            attachment.url = url;
×
460
            return attachment;
×
461
        }
462
    }
463
}
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