io.github.pmckeown.dependencytrack.Response Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dependency-track-maven-plugin Show documentation
Show all versions of dependency-track-maven-plugin Show documentation
Maven plugin to integrate with a Dependency Track server to submit dependency manifests and gather project metrics.
package io.github.pmckeown.dependencytrack;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Optional;
/**
* Wrapper for API responses from the Dependency Track server
*
* @author Paul McKeown
*/
public class Response {
private final int status;
private final String statusText;
private boolean success;
private final Optional body;
public Response(int status, String statusText, boolean success) {
this.status = status;
this.statusText = statusText;
this.success = success;
this.body = Optional.empty();
}
public Response(int status, String statusText, boolean success, Optional body) {
this.status = status;
this.statusText = statusText;
this.success = success;
this.body = body;
}
public int getStatus() {
return this.status;
}
public String getStatusText() {
return this.statusText;
}
public boolean isSuccess() {
return this.success;
}
public Optional getBody() {
return this.body;
}
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy