package com.atlassian.stash.internal.crowd;

import com.atlassian.crowd.embedded.api.User;

/**
 * Filters based on a user's name, display name or email address.
 */
abstract class UserMatchingFilter extends NameMatchingFilter<User> {

    protected UserMatchingFilter(RiotPolice crowdControl, String filter) {
        super(crowdControl, filter);
    }

    @Override
    boolean isMatch(User user) {
        return filterMatchesOneOf(user.getName(), user.getDisplayName(), user.getEmailAddress());
    }
}
