Package com.atlassian.jira.user.util
Class UsersFluentQuery
java.lang.Object
com.atlassian.jira.user.util.UsersFluentQuery
Fluent utility for querying ApplicationUser instances. Instances of this utility class are created by calling
Users.withUser(ApplicationUser) method
Example usage:
ApplicationUser principal = ...;
String result = withUser(principal)
.ifUserGet(ApplicationUser::getName)
.ifServiceGet(ServiceAccountApplicationUser::getName)
.ifNull("anonymous");
Please note two different versions of if* methods:
- Ones ending with *Get accept lambda (function/supplier)
- Methods accepting a value
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionifUser(T userValue) ifUserGet(Function<ApplicationUser, T> userFunction) ifUserOrNull(T userValue) ifUserOrNullGet(Function<ApplicationUser, T> userFunction)
-
Method Details
-
ifUserGet
public <T> UsersFluentQuery.FirstStep<T>.StepUser ifUserGet(Function<ApplicationUser, T> userFunction) -
ifUser
-
ifUserOrNullGet
public <T> UsersFluentQuery.FirstStep<T>.StepUserWithoutNull ifUserOrNullGet(Function<ApplicationUser, T> userFunction) -
ifUserOrNull
-