package com.atlassian.bitbucket.mesh.git.commit;

import com.google.common.collect.ImmutableList;

import javax.annotation.Nonnull;
import java.util.Iterator;
import java.util.List;

import static java.util.Objects.requireNonNull;

public class CommitGraphNode {

    private final String id;
    private final List<String> parentIds;

    public CommitGraphNode(@Nonnull String id, @Nonnull Iterator<String> parentIds) {
        this.id = requireNonNull(id, "id");
        this.parentIds = ImmutableList.copyOf(requireNonNull(parentIds, "parentIds"));
    }

    @Nonnull
    public String getId() {
        return id;
    }

    @Nonnull
    public List<String> getParentIds() {
        return parentIds;
    }
}
