org.gitlab4j.api.models.MergeRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gitlab4j-api Show documentation
Show all versions of gitlab4j-api Show documentation
GitLab4J-API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories and servers via the GitLab REST API.
package org.gitlab4j.api.models;
import java.util.Date;
import java.util.List;
import org.gitlab4j.api.utils.JacksonJson;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
public class MergeRequest {
private Integer approvalsBeforeMerge;
private Assignee assignee;
private Author author;
private List changes;
private Date createdAt;
private String description;
private Integer downvotes;
private Boolean forceRemoveSourceBranch;
private Integer id;
private Integer iid;
private List labels;
private String mergeCommitSha;
private String mergeStatus;
private Boolean mergeWhenBuildSucceeds;
private Milestone milestone;
private Integer projectId;
private String sha;
private Boolean shouldRemoveSourceBranch;
private String sourceBranch;
private Integer sourceProjectId;
private Boolean squash;
private String state;
private Boolean subscribed;
private String targetBranch;
private Integer targetProjectId;
private String title;
private Date updatedAt;
private Integer upvotes;
private Integer userNotesCount;
private String webUrl;
private Boolean workInProgress;
private DiffRef diffRefs;
// The approval fields will only be available when listing approvals, approving or unapproving a merge reuest.
private Integer approvalsRequired;
private Integer approvalsMissing;
@JsonSerialize(using = JacksonJson.UserListSerializer.class)
@JsonDeserialize(using = JacksonJson.UserListDeserializer.class)
private List approvedBy;
public Integer getApprovalsBeforeMerge() {
return approvalsBeforeMerge;
}
public void setApprovalsBeforeMerge(Integer approvalsBeforeMerge) {
this.approvalsBeforeMerge = approvalsBeforeMerge;
}
public Assignee getAssignee() {
return assignee;
}
public void setAssignee(Assignee assignee) {
this.assignee = assignee;
}
public Author getAuthor() {
return author;
}
public void setAuthor(Author author) {
this.author = author;
}
public List getChanges() {
return changes;
}
public void setChanges(List changes) {
this.changes = changes;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getDownvotes() {
return downvotes;
}
public void setDownvotes(Integer downvotes) {
this.downvotes = downvotes;
}
public Boolean getForceRemoveSourceBranch() {
return forceRemoveSourceBranch;
}
public void setForceRemoveSourceBranch(Boolean forceRemoveSourceBranch) {
this.forceRemoveSourceBranch = forceRemoveSourceBranch;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getIid() {
return iid;
}
public void setIid(Integer iid) {
this.iid = iid;
}
public List getLabels() {
return labels;
}
public void setLabels(List labels) {
this.labels = labels;
}
public String getMergeCommitSha() {
return mergeCommitSha;
}
public void setMergeCommitSha(String mergeCommitSha) {
this.mergeCommitSha = mergeCommitSha;
}
public String getMergeStatus() {
return mergeStatus;
}
public void setMergeStatus(String mergeStatus) {
this.mergeStatus = mergeStatus;
}
public Boolean getMergeWhenBuildSucceeds() {
return mergeWhenBuildSucceeds;
}
public void setMergeWhenBuildSucceeds(Boolean mergeWhenBuildSucceeds) {
this.mergeWhenBuildSucceeds = mergeWhenBuildSucceeds;
}
public Milestone getMilestone() {
return milestone;
}
public void setMilestone(Milestone milestone) {
this.milestone = milestone;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getSha() {
return sha;
}
public void setSha(String sha) {
this.sha = sha;
}
public Boolean getShouldRemoveSourceBranch() {
return shouldRemoveSourceBranch;
}
public void setShouldRemoveSourceBranch(Boolean shouldRemoveSourceBranch) {
this.shouldRemoveSourceBranch = shouldRemoveSourceBranch;
}
public String getSourceBranch() {
return sourceBranch;
}
public void setSourceBranch(String sourceBranch) {
this.sourceBranch = sourceBranch;
}
public Integer getSourceProjectId() {
return sourceProjectId;
}
public void setSourceProjectId(Integer sourceProjectId) {
this.sourceProjectId = sourceProjectId;
}
public Boolean getSquash() {
return squash;
}
public void setSquash(Boolean squash) {
this.squash = squash;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Boolean getSubscribed() {
return subscribed;
}
public void setSubscribed(Boolean subscribed) {
this.subscribed = subscribed;
}
public String getTargetBranch() {
return targetBranch;
}
public void setTargetBranch(String targetBranch) {
this.targetBranch = targetBranch;
}
public Integer getTargetProjectId() {
return targetProjectId;
}
public void setTargetProjectId(Integer targetProjectId) {
this.targetProjectId = targetProjectId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Integer getUpvotes() {
return upvotes;
}
public void setUpvotes(Integer upvotes) {
this.upvotes = upvotes;
}
public Integer getUserNotesCount() {
return userNotesCount;
}
public void setUserNotesCount(Integer userNotesCount) {
this.userNotesCount = userNotesCount;
}
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
public Boolean getWorkInProgress() {
return workInProgress;
}
public void setWorkInProgress(Boolean workInProgress) {
this.workInProgress = workInProgress;
}
/**
* Get the number of approvals required for the merge request.
*
* NOTE: This property will only be used when listing, approiving, or unapproving a merge request.
*
* @return the number of approvals required for the merge request
*/
public Integer getApprovalsRequired() {
return approvalsRequired;
}
/**
* Set the number of approvals required for the merge request.
*
* NOTE: This property will only be used when listing, approiving, or unapproving a merge request.
*
* @param approvalsRequired the number of approvals required for the merge request
*/
public void setApprovalsRequired(Integer approvalsRequired) {
this.approvalsRequired = approvalsRequired;
}
/**
* Get the number of approvals missing for the merge request.
*
* NOTE: This property will only be used when listing, approiving, or unapproving a merge request.
*
* @return the number of approvals missing for the merge request
*/
public Integer getApprovalsMissing() {
return approvalsMissing;
}
/**
* Set the number of approvals missing for the merge request.
*
* NOTE: This property will only be used when listing, approiving, or unapproving a merge request.
*
* @param approvalsMissing the number of approvals missing for the merge request
*/
public void setApprovalsMissing(Integer approvalsMissing) {
this.approvalsMissing = approvalsMissing;
}
/**
* Get the list of users that have approved the merge request.
*
* NOTE: This property will only be used when listing, approiving, or unapproving a merge request.
*
* @return the list of users that have approved the merge request
*/
public List getApprovedBy() {
return approvedBy;
}
/**
* Set the list of users that have approved the merge request.
*
* NOTE: This property will only be used when listing, approiving, or unapproving a merge request.
*
* @param approvedBy the list of users that have approved the merge request
*/
public void setApprovedBy(List approvedBy) {
this.approvedBy = approvedBy;
}
public DiffRef getDiffRefs() {
return diffRefs;
}
public void setDiffRefs(final DiffRef diffRefs) {
this.diffRefs = diffRefs;
}
public static final boolean isValid(MergeRequest mergeRequest) {
return (mergeRequest != null && mergeRequest.getId() != null);
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}