public class

UserMatcherPredicate

extends Object
implements Predicate<T>
java.lang.Object
   ↳ com.atlassian.jira.bc.user.search.UserMatcherPredicate

Class Overview

Matcher to compare User parts (username, Full Name and email) with a query string and return true any part matches.

Summary

Public Constructors
UserMatcherPredicate(String query, boolean canMatchAddresses)
UserMatcherPredicate(String nameQuery, String emailQuery, boolean canMatchAddresses)
Search both nameQuery and emailQuery unless one is empty.
Public Methods
boolean apply(ApplicationUser user)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.common.base.Predicate

Public Constructors

public UserMatcherPredicate (String query, boolean canMatchAddresses)

Parameters
query The query to compare. Query can not be null. Empty string will return true for all, so don't pass one in.
canMatchAddresses Whether email should be searched

public UserMatcherPredicate (String nameQuery, String emailQuery, boolean canMatchAddresses)

Search both nameQuery and emailQuery unless one is empty.

If canMatchAddresses is false, email matching is ignored.

  • If both nameQuery and emailQuery are not empty and canMatchAddresses is true, the user's user name/display name has to match nameQuery and email matches emailQuery before considered as a match.
  • If only nameQuery is not empty or both nameQuery and emailQuery are specified but canMatchAddresses is false, nameQuery is used to match against username, display name, and email (when canMatchAddresses is true). But matching on any field is considered a match. This is the same behaviour as the original UserMatcherPredicate(String, boolean) constructor
  • If only emailQuery is not empty and canMatchAddresses is true, emailQuery is used to match against email only.
  • if both are empty or only emailQuery is not empty but canMatchAddresses is false, it's always considered a match. Avoid it.

When emailQuery is not empty and canMatchAddresses is true, it corresponds to the search behaviour in the user picker popup browser where email search field is entered some value.

Parameters
nameQuery The query on user name
emailQuery The query on email
canMatchAddresses Whether email should be searched

Public Methods

public boolean apply (ApplicationUser user)