package it.com.atlassian.stash.ssh;

import com.atlassian.webdriver.bitbucket.element.AccessKeyRow;
import com.google.common.base.Predicate;

import javax.annotation.Nullable;

public class SshKeyRowFinderPredicate implements Predicate<AccessKeyRow> {

    private String publicKeyId;

    public SshKeyRowFinderPredicate(String publicKeyId) {
        this.publicKeyId = publicKeyId;
    }

    @Override
    public boolean apply(@Nullable AccessKeyRow inputRow) {
        return inputRow.hasAttribute("data-key-id", publicKeyId);
    }

}
