package com.atlassian.stash.internal.scm.git.command.status;

import com.atlassian.stash.internal.scm.git.GitStatus;
import com.google.common.collect.ImmutableList;

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

public class CollectingStatusCallback implements StatusCallback {

    private final ImmutableList.Builder<GitStatus> statuses = ImmutableList.builder();

    @Override
    public void onStatus(@Nonnull GitStatus status) {
        statuses.add(status);
    }

    @Nonnull
    public List<GitStatus> getStatuses() {
        return statuses.build();
    }
}
