Class BotSentryList


  • public class BotSentryList
    extends Object
    The base operations for the black- and whitelist.
    • Method Detail

      • isWhitelist

        public boolean isWhitelist()
        Gives the list type of the current object in a boolean format. True: whitelist, false: blacklist.
        Returns:
        The list type.
      • contains

        public void contains​(String ip,
                             Consumer<Boolean> callback)
                      throws IllegalArgumentException
        Gives the contains value of the given IP in this list asynchronously.
        Parameters:
        ip - The ip to check if it is inside the list.
        callback - The callback object, it will return the contains value when it is retrieved asynchronously.
        Throws:
        IllegalArgumentException - If the IP is not in the correct IPv4 format.
      • add

        public void add​(String ip)
                 throws IllegalArgumentException
        Adds an IP to the list asynchronously. If the IP is already inside the list, it will do nothing.
        Parameters:
        ip - The ip to add to the list.
        Throws:
        IllegalArgumentException - If the IP is not in the correct IPv4 format.
      • remove

        public void remove​(String ip)
                    throws IllegalArgumentException
        Removes an IP from the list asynchronously. If the IP is not in the list, it will do nothing.
        Parameters:
        ip - The ip to remove from the list.
        Throws:
        IllegalArgumentException - If the IP is not in the correct IPv4 format.
      • get

        public void get​(Consumer<Set<String>> callback)
        Gives all IPs in this list asynchronously.
        Parameters:
        callback - The callback object, it will return all IPs in this list when it is retrieved asynchronously.
      • clear

        public void clear()
        Clears this list fully asynchronously.