Добавил новый UnitTrigger
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Struchkov Mark 2023-12-03 17:42:58 +03:00
parent 872c5f4886
commit 04e5d3435b
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -54,6 +54,13 @@ public class UnitTrigger {
.isPresent(); .isPresent();
} }
public static Predicate<Mail> isButtonClickArgValue(String argType, String argValue) {
return mail -> Attachments.findFirstButtonClick(mail.getAttachments())
.flatMap(click -> click.getArgByType(argType))
.filter(buttonArg -> argValue.equals(buttonArg.getValue()))
.isPresent();
}
public static Predicate<Mail> isPersonId(String... personId) { public static Predicate<Mail> isPersonId(String... personId) {
return mail -> Arrays.stream(personId).anyMatch(id -> id.equals(mail.getFromPersonId())); return mail -> Arrays.stream(personId).anyMatch(id -> id.equals(mail.getFromPersonId()));
} }