Commit 2f2d2b45 authored by Greg Messner's avatar Greg Messner
Browse files

Implemented toString() (#320).

parent 88ec32b9
...@@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlAccessorType; ...@@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.Diff; import org.gitlab4j.api.models.Diff;
import org.gitlab4j.api.models.User; import org.gitlab4j.api.models.User;
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper; import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
...@@ -260,4 +261,9 @@ public class NoteEvent extends AbstractEvent { ...@@ -260,4 +261,9 @@ public class NoteEvent extends AbstractEvent {
this.url = url; this.url = url;
} }
} }
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
} }
...@@ -8,6 +8,7 @@ import javax.xml.bind.annotation.XmlAccessorType; ...@@ -8,6 +8,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.ArtifactsFile; import org.gitlab4j.api.models.ArtifactsFile;
import org.gitlab4j.api.models.User; import org.gitlab4j.api.models.User;
import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PipelineEvent extends AbstractEvent { public class PipelineEvent extends AbstractEvent {
...@@ -268,4 +269,9 @@ public class PipelineEvent extends AbstractEvent { ...@@ -268,4 +269,9 @@ public class PipelineEvent extends AbstractEvent {
this.duration = duration; this.duration = duration;
} }
} }
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
} }
...@@ -4,6 +4,8 @@ package org.gitlab4j.api.webhook; ...@@ -4,6 +4,8 @@ package org.gitlab4j.api.webhook;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class PushEvent extends AbstractPushEvent implements Event { public class PushEvent extends AbstractPushEvent implements Event {
...@@ -20,4 +22,9 @@ public class PushEvent extends AbstractPushEvent implements Event { ...@@ -20,4 +22,9 @@ public class PushEvent extends AbstractPushEvent implements Event {
throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'"); throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'");
} }
} }
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
} }
...@@ -4,6 +4,8 @@ package org.gitlab4j.api.webhook; ...@@ -4,6 +4,8 @@ package org.gitlab4j.api.webhook;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class TagPushEvent extends AbstractPushEvent implements Event { public class TagPushEvent extends AbstractPushEvent implements Event {
...@@ -19,4 +21,9 @@ public class TagPushEvent extends AbstractPushEvent implements Event { ...@@ -19,4 +21,9 @@ public class TagPushEvent extends AbstractPushEvent implements Event {
if (!OBJECT_KIND.equals(objectKind)) if (!OBJECT_KIND.equals(objectKind))
throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'"); throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'");
} }
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
} }
...@@ -4,6 +4,7 @@ import javax.xml.bind.annotation.XmlAccessType; ...@@ -4,6 +4,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.User; import org.gitlab4j.api.models.User;
import org.gitlab4j.api.utils.JacksonJson;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class WikiPageEvent extends AbstractEvent { public class WikiPageEvent extends AbstractEvent {
...@@ -174,4 +175,9 @@ public class WikiPageEvent extends AbstractEvent { ...@@ -174,4 +175,9 @@ public class WikiPageEvent extends AbstractEvent {
this.url = url; this.url = url;
} }
} }
@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