forked from gitlab4j/gitlab4j-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLabel.java
168 lines (131 loc) · 3.92 KB
/
Label.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package org.gitlab4j.api.models;
import java.io.Serializable;
import org.gitlab4j.models.GitLabForm;
import org.gitlab4j.models.utils.JacksonJson;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Label implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String name;
private String color;
private String description;
private String descriptionHtml;
private String textColor;
private Integer openIssuesCount;
private Integer closedIssuesCount;
private Integer openMergeRequestsCount;
private Boolean subscribed;
private Integer priority;
private Boolean isProjectLabel;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Label withName(String name) {
this.name = name;
return (this);
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Label withColor(String color) {
this.color = color;
return (this);
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Label withDescription(String description) {
this.description = description;
return (this);
}
public String getDescriptionHtml() {
return descriptionHtml;
}
public void setDescriptionHtml(String descriptionHtml) {
this.descriptionHtml = descriptionHtml;
}
public String getTextColor() {
return textColor;
}
public void setTextColor(String textColor) {
this.textColor = textColor;
}
public Integer getOpenIssuesCount() {
return openIssuesCount;
}
public void setOpenIssuesCount(Integer openIssuesCount) {
this.openIssuesCount = openIssuesCount;
}
public Integer getClosedIssuesCount() {
return closedIssuesCount;
}
public void setClosedIssuesCount(Integer closedIssuesCount) {
this.closedIssuesCount = closedIssuesCount;
}
public Integer getOpenMergeRequestsCount() {
return openMergeRequestsCount;
}
public void setOpenMergeRequestsCount(Integer openMergeRequestsCount) {
this.openMergeRequestsCount = openMergeRequestsCount;
}
public Boolean isSubscribed() {
return subscribed;
}
public void setSubscribed(Boolean subscribed) {
this.subscribed = subscribed;
}
public Integer getPriority() {
return priority;
}
public void setPriority(Integer priority) {
this.priority = priority;
}
public Label withPriority(Integer priority) {
this.priority = priority;
return (this);
}
public Boolean getIsProjectLabel() {
return isProjectLabel;
}
public void setIsProjectLabel(Boolean isProjectLabel) {
this.isProjectLabel = isProjectLabel;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
/**
* Get the form params specified by this instance.
*
* @param isCreate set to true if the params are for a create label call, false for an update
* @return a GitLabApiForm instance holding the form parameters for this LabelParams instance
*/
@JsonIgnore
public GitLabForm getForm(boolean isCreate) {
GitLabForm form = new GitLabForm()
.withParam("description", description)
.withParam("color", color, isCreate)
.withParam("priority", priority);
if (isCreate) {
form.withParam("name", name, true);
} else {
form.withParam("new_name", name);
}
return (form);
}
}