|
6 | 6 | import javax.xml.bind.annotation.XmlAccessorType;
|
7 | 7 | import javax.xml.bind.annotation.XmlRootElement;
|
8 | 8 |
|
| 9 | +import org.gitlab4j.api.utils.JacksonJson; |
| 10 | + |
9 | 11 | @XmlRootElement
|
10 | 12 | @XmlAccessorType(XmlAccessType.FIELD)
|
11 | 13 | public class SystemHook {
|
@@ -74,18 +76,43 @@ public Boolean getRepositoryUpdateEvents() {
|
74 | 76 | return repositoryUpdateEvents;
|
75 | 77 | }
|
76 | 78 |
|
| 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 | + |
77 | 114 | @Override
|
78 | 115 | 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)); |
89 | 117 | }
|
90 |
| - |
91 | 118 | }
|
0 commit comments