Commit b3b0867a authored by Greg Messner's avatar Greg Messner
Browse files

Added withXXX() methods (#235).

parent b50c50a2
......@@ -6,6 +6,8 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.gitlab4j.api.utils.JacksonJson;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class SystemHook {
......@@ -74,18 +76,43 @@ public class SystemHook {
return repositoryUpdateEvents;
}
public SystemHook withId(Integer id) {
this.id = id;
return (this);
}
public SystemHook withUrl(String url) {
this.url = url;
return (this);
}
public SystemHook withCreatedAt(Date createdAt) {
this.createdAt = createdAt;
return (this);
}
public SystemHook withPushEvents(Boolean pushEvents) {
this.pushEvents = pushEvents;
return (this);
}
public SystemHook withTagPushEvents(Boolean tagPushEvents) {
this.tagPushEvents = tagPushEvents;
return (this);
}
public SystemHook withEnableSslVerification(Boolean enableSslVerification) {
this.enableSslVerification = enableSslVerification;
return (this);
}
public SystemHook withRepositoryUpdateEvents(Boolean repositoryUpdateEvents) {
this.repositoryUpdateEvents = repositoryUpdateEvents;
return (this);
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("SystemHook{");
sb.append("id=").append(id);
sb.append(", url='").append(url).append('\'');
sb.append(", createdAt=").append(createdAt);
sb.append(", pushEvents=").append(pushEvents);
sb.append(", tagPushEvents=").append(tagPushEvents);
sb.append(", enableSslVerification=").append(enableSslVerification);
sb.append(", repositoryUpdateEvents=").append(repositoryUpdateEvents);
sb.append('}');
return sb.toString();
return (JacksonJson.toJsonString(this));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment