package com.atlassian.stash.internal.scm.git.binary;

import com.atlassian.bitbucket.i18n.I18nKey;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * @since 3.0
 */
public class RejectedGitBinary {

    private final GitBinary binary;
    private final I18nKey i18nKey;

    public RejectedGitBinary(@Nonnull I18nKey i18nKey) {
        this(i18nKey, null);
    }

    public RejectedGitBinary(@Nonnull I18nKey i18nKey, @Nullable GitBinary binary) {
        this.binary = binary;
        this.i18nKey = checkNotNull(i18nKey, "i18nKey");
    }

    @Nullable
    public GitBinary getBinary() {
        return binary;
    }

    @Nonnull
    public I18nKey getI18nKey() {
        return i18nKey;
    }

    public boolean isFound() {
        return binary != null;
    }
}
