Skip to content

Commit b3b0867

Browse files
committed
Added withXXX() methods (#235).
1 parent b50c50a commit b3b0867

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

src/main/java/org/gitlab4j/api/models/SystemHook.java

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import javax.xml.bind.annotation.XmlAccessorType;
77
import javax.xml.bind.annotation.XmlRootElement;
88

9+
import org.gitlab4j.api.utils.JacksonJson;
10+
911
@XmlRootElement
1012
@XmlAccessorType(XmlAccessType.FIELD)
1113
public class SystemHook {
@@ -74,18 +76,43 @@ public Boolean getRepositoryUpdateEvents() {
7476
return repositoryUpdateEvents;
7577
}
7678

79+
public SystemHook withId(Integer id) {
80+
this.id = id;
81+
return (this);
82+
}
83+
84+
public SystemHook withUrl(String url) {
85+
this.url = url;
86+
return (this);
87+
}
88+
89+
public SystemHook withCreatedAt(Date createdAt) {
90+
this.createdAt = createdAt;
91+
return (this);
92+
}
93+
94+
public SystemHook withPushEvents(Boolean pushEvents) {
95+
this.pushEvents = pushEvents;
96+
return (this);
97+
}
98+
99+
public SystemHook withTagPushEvents(Boolean tagPushEvents) {
100+
this.tagPushEvents = tagPushEvents;
101+
return (this);
102+
}
103+
104+
public SystemHook withEnableSslVerification(Boolean enableSslVerification) {
105+
this.enableSslVerification = enableSslVerification;
106+
return (this);
107+
}
108+
109+
public SystemHook withRepositoryUpdateEvents(Boolean repositoryUpdateEvents) {
110+
this.repositoryUpdateEvents = repositoryUpdateEvents;
111+
return (this);
112+
}
113+
77114
@Override
78115
public String toString() {
79-
final StringBuilder sb = new StringBuilder("SystemHook{");
80-
sb.append("id=").append(id);
81-
sb.append(", url='").append(url).append('\'');
82-
sb.append(", createdAt=").append(createdAt);
83-
sb.append(", pushEvents=").append(pushEvents);
84-
sb.append(", tagPushEvents=").append(tagPushEvents);
85-
sb.append(", enableSslVerification=").append(enableSslVerification);
86-
sb.append(", repositoryUpdateEvents=").append(repositoryUpdateEvents);
87-
sb.append('}');
88-
return sb.toString();
116+
return (JacksonJson.toJsonString(this));
89117
}
90-
91118
}

0 commit comments

Comments
 (0)