Добавил метод в UnitTrigger
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Struchkov Mark 2023-04-09 11:24:12 +03:00
parent 955d7b4841
commit f561786d58
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -4,6 +4,7 @@ import dev.struchkov.godfather.main.domain.content.Mail;
import dev.struchkov.godfather.telegram.domain.attachment.ButtonClickAttachment;
import dev.struchkov.godfather.telegram.main.core.util.Attachments;
import java.util.Arrays;
import java.util.Optional;
import java.util.function.Predicate;
@ -41,4 +42,8 @@ public class UnitTrigger {
.isPresent();
}
public static Predicate<Mail> isPersonId(String... personId) {
return mail -> Arrays.stream(personId).anyMatch(id -> id.equals(mail.getFromPersonId()));
}
}