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

com.vmware.connectors.github.pr.PullRequestId Maven / Gradle / Ivy

/*
 * Copyright © 2018 VMware, Inc. All Rights Reserved.
 * SPDX-License-Identifier: BSD-2-Clause
 */

package com.vmware.connectors.github.pr;


import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import static org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE;

/**
 * All Pull Requests and related objects (reviews and comments) have this
 * information as part of their identity.
 */
public class PullRequestId {

    private final String owner;
    private final String repo;
    private final String number;

    public PullRequestId(String owner, String repo, String number) {
        this.owner = owner;
        this.repo = repo;
        this.number = number;
    }

    public String getOwner() {
        return owner;
    }

    public String getRepo() {
        return repo;
    }

    public String getNumber() {
        return number;
    }

    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, SHORT_PREFIX_STYLE);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy