Class Reply

  • Direct Known Subclasses:
    ReplyFlow

    public class Reply
    extends Object
    A reply consists of update conditionals and an action to be applied on the update.

    If an update satisfies the conditions set by the reply, then it's safe to actOn(Update).

    Author:
    Abbas Abou Daya
    • Field Detail

      • conditions

        public final List<Predicate<org.telegram.telegrambots.meta.api.objects.Update>> conditions
      • action

        public final Consumer<org.telegram.telegrambots.meta.api.objects.Update> action
    • Method Detail

      • of

        public static Reply of​(Consumer<org.telegram.telegrambots.meta.api.objects.Update> action,
                               List<Predicate<org.telegram.telegrambots.meta.api.objects.Update>> conditions)
      • of

        @SafeVarargs
        public static Reply of​(Consumer<org.telegram.telegrambots.meta.api.objects.Update> action,
                               Predicate<org.telegram.telegrambots.meta.api.objects.Update>... conditions)
      • isOkFor

        public boolean isOkFor​(org.telegram.telegrambots.meta.api.objects.Update update)
      • actOn

        public void actOn​(org.telegram.telegrambots.meta.api.objects.Update update)
      • conditions

        public List<Predicate<org.telegram.telegrambots.meta.api.objects.Update>> conditions()
      • action

        public Consumer<org.telegram.telegrambots.meta.api.objects.Update> action()
      • enableStats

        public Reply enableStats​(String name)
      • statsEnabled

        public boolean statsEnabled()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object