Class BotBlockAPI.Builder

  • Enclosing class:
    BotBlockAPI

    public static class BotBlockAPI.Builder
    extends java.lang.Object
    Builder class to create an instance of BotBlockAPI
    • Constructor Detail

      • Builder

        public Builder()
        Empty constructor to get the class.
    • Method Detail

      • addAuthToken

        public BotBlockAPI.Builder addAuthToken​(@NotNull
                                                @NotNull Site site,
                                                @NotNull
                                                @NotNull java.lang.String token)
        Adds the provided Site name and token to the Map.
        Entries with the same key will be overwritten.
        Parameters:
        site - The Site to get the name from.
        token - The API token from the corresponding bot list. May not be null or empty.
        You may receive the API token from the bot list.
        Returns:
        The Builder after the site and token were set. Useful for chaining.
        Throws:
        java.lang.NullPointerException - When the provided token is empty ("").
        Since:
        v2.1.0
      • addAuthToken

        public BotBlockAPI.Builder addAuthToken​(@NotNull
                                                @NotNull java.lang.String site,
                                                @NotNull
                                                @NotNull java.lang.String token)
        Adds the provided Site name and token to the Map.
        Entries with the same key will be overwritten.
        Parameters:
        site - The name of the site. May not be null.
        A list of supported sites can be found here.
        token - The API token from the corresponding bot list. May not be null or empty.
        You may receive the API token from the bot list.
        Returns:
        The Builder after the site and token were set. Useful for chaining.
        Throws:
        java.lang.NullPointerException - When either the site or token are empty ("").
      • setAuthTokens

        public BotBlockAPI.Builder setAuthTokens​(@NotNull
                                                 @NotNull java.util.Map<java.lang.String,​java.lang.String> authTokens)
        Sets the provided Map as the new Map.
        This will overwrite every previously set entry!
        Parameters:
        authTokens - The Map that should be used. May not be null.
        Returns:
        The Builder after the Map was set. Useful for chaining.
        Throws:
        java.lang.NullPointerException - When the provided Map is empty.
      • setUpdateInteval

        public BotBlockAPI.Builder setUpdateInteval​(int updateInterval)
        Sets the update interval in minutes for the auto-posting.
        You don't need to set this when not using the auto-post option. Default is 30.
        Parameters:
        updateInterval - The update interval in minutes that should be used. This can't be less than 2.
        Returns:
        The Builder after the updateInterval was set. Useful for chaining.
        Throws:
        java.lang.IllegalArgumentException - When the updateInterval is less than 2.