Skip to content

Commit

Permalink
Add event.requesteeIs method (MID-4598)
Browse files Browse the repository at this point in the history
Also with shortcut event.requesteeIsUser().
  • Loading branch information
mederly committed Mar 13, 2020
1 parent fce73ae commit 5319ef3
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -57,6 +57,18 @@ default String getRequesterOid() {
*/
SimpleObjectRef getRequestee();

/**
* @return true if requestee is of give type
*/
default boolean requesteeIs(Class<?> type) {
ObjectType requesteeObject = getRequesteeObject();
return requesteeObject != null && type.isAssignableFrom(requesteeObject.getClass());
}

default boolean requesteeIsUser() {
return requesteeIs(UserType.class);
}

/**
* @return resolved requestee object (or null)
*/
Expand Down

0 comments on commit 5319ef3

Please sign in to comment.