• 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

34.78
/src/main/java/com/smartsheet/api/models/Workspace.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.AccessLevel;
24

25
/**
26
 * Represents the Workspace object which is an area in which sheets, reports, templates and sub-folders can be
27
 * organized, similar to a folder.
28
 * @see <a href="http://help.smartsheet.com/customer/portal/articles/506687-creating-a-workspace">Help Creating a
29
 * Workspace</a>
30
 */
31
public class Workspace extends Folder {
1✔
32
    /** Represents the user's permissions on a workspace. */
33
    private AccessLevel accessLevel;
34

35
    /** Represents the link . */
36
    private String permalink;
37

38
    /**
39
     *  Represents if the workspace is marked as favorite
40
     */
41
    private Boolean favorite;
42

43
    /**
44
     * Gets the user's permissions on a workspace.
45
     *
46
     * @return the access level
47
     */
48
    public AccessLevel getAccessLevel() {
49
        return accessLevel;
1✔
50
    }
51

52
    /**
53
     * Sets the user's permissions on a workspace.
54
     *
55
     * @param accessLevel the new access level
56
     */
57
    public Workspace setAccessLevel(AccessLevel accessLevel) {
58
        this.accessLevel = accessLevel;
1✔
59
        return this;
1✔
60
    }
61

62
    /**
63
     * Gets the permalink to the workspace.
64
     *
65
     * @return the permalink
66
     */
67
    public String getPermalink() {
68
        return permalink;
1✔
69
    }
70

71
    /**
72
     * Sets the permalink to the workspace.
73
     *
74
     * @param permalink the new permalink
75
     */
76
    public Folder setPermalink(String permalink) {
77
        this.permalink = permalink;
1✔
78
        return null;
1✔
79
    }
80

81
    /**
82
     * Gets the favorite
83
     * @return the favorite
84
     */
85
    public Boolean getFavorite() {
86
        return favorite;
1✔
87
    }
88

89
    /**
90
     * Sets the favorite
91
     * @param favorite the favorite
92
     */
93
    public Folder setFavorite(Boolean favorite) {
94
        this.favorite = favorite;
×
95
        return null;
×
96
    }
97

98
    /**
99
     * A convenience class for creating a {@link Workspace} object with the appropriate fields for updating a workspace.
100
     */
101
    public static class UpdateWorkspaceBuilder {
×
102
        private String workspaceName;
103
        private Long id;
104

105
        /**
106
         * Get the workspace id
107
         * @return the workspace id
108
         */
109
        public Long getId() {
110
            return id;
×
111
        }
112

113
        /**
114
         * Set the workspace id
115
         * @param id the workspace id
116
         * @return the builder
117
         */
118
        public UpdateWorkspaceBuilder setId(Long id) {
119
            this.id = id;
×
120
            return this;
×
121
        }
122

123
        /**
124
         * The name of the workspace.
125
         *
126
         * @param name the name
127
         * @return the update workspace builder
128
         */
129
        public UpdateWorkspaceBuilder setName(String name) {
130
            this.workspaceName = name;
×
131
            return this;
×
132
        }
133

134
        /**
135
         * Gets the name.
136
         *
137
         * @return the name
138
         */
139
        public String getName() {
140
            return workspaceName;
×
141
        }
142

143
        /**
144
         * Builds the {@link Workspace}.
145
         *
146
         * @return the workspace
147
         */
148
        public Workspace build() {
149
            if (workspaceName == null) {
×
150
                throw new InstantiationError("A workspace name is required.");
×
151
            }
152

153
            Workspace workspace = new Workspace();
×
154
            workspace.setName(workspaceName);
×
155
            workspace.setId(id);
×
156
            return workspace;
×
157
        }
158
    }
159
}
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