Unverified Commit b9bf3e92 authored by Greg Messner's avatar Greg Messner Committed by GitHub
Browse files

Added toString() implementation to model classes (#271)

parent d5c5bd87
......@@ -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 Pipeline {
......@@ -145,4 +147,9 @@ public class Pipeline {
public void setDuration(Integer duration) {
this.duration = duration;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -8,6 +8,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import com.fasterxml.jackson.annotation.JsonCreator;
......@@ -633,4 +634,8 @@ public class Project {
return (project != null && project.getId() != null);
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -3,6 +3,8 @@ package org.gitlab4j.api.models;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType (XmlAccessType.FIELD)
public class ProjectAccess {
......@@ -24,4 +26,9 @@ public class ProjectAccess {
public void setNotificationLevel(int notificationLevel) {
this.notificationLevel = notificationLevel;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -7,6 +7,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;
import com.fasterxml.jackson.annotation.JsonIgnore;
@XmlRootElement
......@@ -269,4 +271,9 @@ public class ProjectHook {
public void setWiki_page_events(Boolean wikiPageEvents) {
this.wikiPageEvents = wikiPageEvents;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package org.gitlab4j.api.models;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType(XmlAccessType.FIELD)
public class ProjectSharedGroup {
......@@ -33,4 +35,9 @@ public class ProjectSharedGroup {
public void setGroupAccessLevel(AccessLevel accessLevel) {
this.groupAccessLevel = accessLevel;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -4,6 +4,8 @@ package org.gitlab4j.api.models;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJson;
/**
* This class contains the sizing information from the project. To get this information,
* ProjectApi.getProject() has to be called with parameter statistics=true
......@@ -48,4 +50,9 @@ public class ProjectStatistics {
public void setStorageSize(long storageSize) {
this.storageSize = storageSize;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -4,6 +4,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 ProjectUser {
......@@ -62,4 +64,9 @@ public class ProjectUser {
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
package org.gitlab4j.api.models;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import org.gitlab4j.api.utils.JacksonJson;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
......@@ -42,7 +45,6 @@ public class ProtectedBranch {
return (branch != null && branch.getName() != null);
}
public ProtectedBranch withName(String name) {
this.name = name;
return this;
......@@ -57,4 +59,9 @@ public class ProtectedBranch {
this.mergeAccessLevels = mergeAccessLevels;
return this;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.gitlab4j.api.Constants.ActionType;
import org.gitlab4j.api.utils.JacksonJson;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
......@@ -65,4 +66,9 @@ public class PushData {
public void setRef(String ref) {
this.ref = ref;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -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 PushRules {
......@@ -53,8 +55,8 @@ public class PushRules {
public PushRules withCommitMessageRegex(String commitMessageRegex) {
this.commitMessageRegex = commitMessageRegex;
return (this);
}
return (this);
}
public String getBranchNameRegex() {
return branchNameRegex;
......@@ -66,8 +68,8 @@ public class PushRules {
public PushRules withBranchNameRegex(String branchNameRegex) {
this.branchNameRegex = branchNameRegex;
return (this);
}
return (this);
}
public Boolean getDenyDeleteTag() {
return denyDeleteTag;
......@@ -79,8 +81,8 @@ public class PushRules {
public PushRules withDenyDeleteTag(Boolean denyDeleteTag) {
this.denyDeleteTag = denyDeleteTag;
return (this);
}
return (this);
}
public Date getCreatedAt() {
return createdAt;
......@@ -100,8 +102,8 @@ public class PushRules {
public PushRules withMemberCheck(Boolean memberCheck) {
this.memberCheck = memberCheck;
return (this);
}
return (this);
}
public Boolean getPreventSecrets() {
return preventSecrets;
......@@ -113,8 +115,8 @@ public class PushRules {
public PushRules withPreventSecrets(Boolean preventSecrets) {
this.preventSecrets = preventSecrets;
return (this);
}
return (this);
}
public String getAuthorEmailRegex() {
return authorEmailRegex;
......@@ -126,8 +128,8 @@ public class PushRules {
public PushRules withAuthorEmailRegex(String authorEmailRegex) {
this.authorEmailRegex = authorEmailRegex;
return (this);
}
return (this);
}
public String getFileNameRegex() {
return fileNameRegex;
......@@ -139,8 +141,8 @@ public class PushRules {
public PushRules withFileNameRegex(String fileNameRegex) {
this.fileNameRegex = fileNameRegex;
return (this);
}
return (this);
}
public Integer getMaxFileSize() {
return maxFileSize;
......@@ -152,6 +154,11 @@ public class PushRules {
public PushRules withMaxFileSize(Integer maxFileSize) {
this.maxFileSize = maxFileSize;
return (this);
}
return (this);
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -4,6 +4,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 Release {
......@@ -26,4 +28,9 @@ public class Release {
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -4,6 +4,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 Repository {
......@@ -44,4 +46,9 @@ public class Repository {
public void setUrl(String url) {
this.url = url;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -7,6 +7,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;
import com.fasterxml.jackson.annotation.JsonIgnore;
@XmlRootElement
......@@ -163,4 +165,9 @@ public class RepositoryFile {
this.content = Base64.getEncoder().encodeToString(byteContent);
encoding = "base64";
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
package org.gitlab4j.api.models;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Runner {
......@@ -150,4 +152,9 @@ public class Runner {
this.ipAddress = ipAddress;
return this;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
package org.gitlab4j.api.models;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
import java.util.List;
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
......@@ -166,4 +168,9 @@ public class RunnerDetail extends Runner {
this.accessLevel = accessLevel;
return this;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -7,6 +7,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 Session {
......@@ -227,4 +229,9 @@ public class Session {
public void setWebsiteUrl(String websiteUrl) {
this.websiteUrl = websiteUrl;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -29,6 +29,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 Snippet {
......@@ -156,4 +158,9 @@ public class Snippet {
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -5,6 +5,8 @@ import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJson;
import com.fasterxml.jackson.annotation.JsonIgnore;
@XmlAccessorType(XmlAccessType.FIELD)
......@@ -57,4 +59,9 @@ public class SshKey {
public void setUserId(Integer userId) {
this.userId = userId;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -4,6 +4,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 Tag {
......@@ -44,4 +46,9 @@ public class Tag {
public void setRelease(Release release) {
this.release = release;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -4,6 +4,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 TimeStats {
......@@ -44,4 +46,9 @@ public class TimeStats {
public void setHumanTotalTimeSpent(Duration humanTotalTimeSpent) {
this.humanTotalTimeSpent = humanTotalTimeSpent;
}
@Override
public String 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