package com.atlassian.bitbucket.web.conditions;

import com.atlassian.bitbucket.auth.AuthenticationContext;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.web.Condition;

import java.util.Map;

/**
 * A condition which checks if the current user has approved the current pull request
 *
 * @deprecated in 4.2 for removal in 5.0. Use {@link HasApprovedPullRequestCondition} instead
 */
@Deprecated
public class HasPullRequestApproveCondition implements Condition {

    private final Condition delegate;

    public HasPullRequestApproveCondition(AuthenticationContext authenticationContext) {
        delegate = new HasApprovedPullRequestCondition(authenticationContext);
    }

    @Override
    public void init(Map<String, String> params) throws PluginParseException {
        delegate.init(params);
    }

    @Override
    public boolean shouldDisplay(Map<String, Object> context) {
        return delegate.shouldDisplay(context);
    }
}
