package com.atlassian.stash.internal.pull;

/**
 * @since 2.5
 */
public enum PullRequestRescopeCommitAction {

    ADDED(0),
    REMOVED(1);

    private final int id;

    private PullRequestRescopeCommitAction(int id) {
        this.id = id;
    }

    public static PullRequestRescopeCommitAction fromId(int id) {
        for (PullRequestRescopeCommitAction action : values()) {
            if (id == action.getId()) {
                return action;
            }
        }
        throw new IllegalArgumentException("No PullRequestRescopeCommitAction is associated with ID [" + id + "]");
    }

    public int getId() {
        return id;
    }
}
