package com.atlassian.stash.internal.repository.ref.restriction;

import com.atlassian.bitbucket.repository.ref.restriction.RefRestriction;
import com.atlassian.bitbucket.repository.ref.restriction.RefRestrictionType;
import com.google.common.base.Predicate;

public class RestrictionTypePredicate implements Predicate<RefRestriction> {
    
    private final RefRestrictionType type;

    public RestrictionTypePredicate(RefRestrictionType type) {
        this.type = type;
    }

    @Override
    public boolean apply(RefRestriction restriction) {
        return restriction != null && type == restriction.getType();
    }
}
