From fe2aa2a7fbeb7d7a07346750ee599795aa49b18a Mon Sep 17 00:00:00 2001 From: mathias Date: Sun, 3 Oct 2021 21:10:42 +0200 Subject: [PATCH] Created the LockedChannel entity --- .../autoresponder/entities/LockedChannel.java | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/main/java/de/gnmyt/autoresponder/entities/LockedChannel.java diff --git a/src/main/java/de/gnmyt/autoresponder/entities/LockedChannel.java b/src/main/java/de/gnmyt/autoresponder/entities/LockedChannel.java new file mode 100644 index 0000000..bd18ca4 --- /dev/null +++ b/src/main/java/de/gnmyt/autoresponder/entities/LockedChannel.java @@ -0,0 +1,64 @@ +package de.gnmyt.autoresponder.entities; + +import de.gnmyt.autoresponder.event.ResponderEvent; + +import java.util.function.Consumer; + +public class LockedChannel { + + private final String groupName; + private final boolean isGroup; + private final String sender; + private final Consumer consumer; + + /** + * Constructor of the {@link LockedChannel} + * + * @param groupName The name of the group that sent the message + * @param isGroup true if the provided channel is a group, otherwise false + * @param sender The sender of the message + * @param consumer The action that should be executed after the message has been answered + */ + public LockedChannel(String groupName, boolean isGroup, String sender, Consumer consumer) { + this.consumer = consumer; + this.groupName = groupName; + this.isGroup = isGroup; + this.sender = sender; + } + + /** + * Gets the name of the group + * + * @return the name of the group + */ + public String getGroupName() { + return groupName; + } + + /** + * Checks if the provided channel is a group + * + * @return true if the provided channel is a group, otherwise false + */ + public boolean isGroup() { + return isGroup; + } + + /** + * Gets the sender + * + * @return the sender + */ + public String getSender() { + return sender; + } + + /** + * Gets the consumer + * + * @return the consumer + */ + public Consumer getConsumer() { + return consumer; + } +}