All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nulabinc.backlog4j.internal.json.activities.PullRequestContent Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package com.nulabinc.backlog4j.internal.json.activities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.nulabinc.backlog4j.*;
import com.nulabinc.backlog4j.internal.json.ChangeJSONImpl;
import com.nulabinc.backlog4j.internal.json.CommentJSONImpl;
import com.nulabinc.backlog4j.internal.json.IssueJSONImpl;
import com.nulabinc.backlog4j.internal.json.RepositoryJSONImpl;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Arrays;
import java.util.List;

/**
 * @author nulab-inc
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class PullRequestContent extends Content {

    private long id;
    private long number;
    private String summary;
    private String description;
    @JsonDeserialize(as=CommentJSONImpl.class)
    private Comment comment;
    @JsonDeserialize(as= ChangeJSONImpl[].class)
    private Change[] changes;
    @JsonDeserialize(as=RepositoryJSONImpl.class)
    private Repository repository;
    @JsonDeserialize(as=IssueJSONImpl.class)
    private Issue issue;

    public long getId() {
        return this.id;
    }

    public long getNumber() {
        return this.number;
    }

    public String getSummary() {
        return summary;
    }

    public String getDescription() {
        return description;
    }

    public Comment getComment() {
        return comment;
    }

    public List getChanges() {
        return Arrays.asList(this.changes);
    }

    public Repository getRepository() {
        return repository;
    }

    public Issue getIssue() { return issue; }
 
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != getClass()) {
            return false;
        }
        PullRequestContent rhs = (PullRequestContent) obj;
        return new EqualsBuilder()
                .append(this.id, rhs.id)
                .append(this.number, rhs.number)
                .append(this.summary, rhs.summary)
                .append(this.description, rhs.description)
                .append(this.comment, rhs.comment)
                .append(this.changes, rhs.changes)
                .append(this.repository, rhs.repository)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder()
                .append(id)
                .append(number)
                .append(summary)
                .append(description)
                .append(comment)
                .append(changes)
                .append(repository)
                .toHashCode();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("keyId", number)
                .append("summary", summary)
                .append("description", description)
                .append("comment", comment)
                .append("changes", changes)
                .append("repository", repository)
                .toString();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy