Class ImmutablePrefixHandler

  • All Implemented Interfaces:
    PrefixHandler

    public final class ImmutablePrefixHandler
    extends java.lang.Object
    implements PrefixHandler
    Represents a prefix handler with immutable prefix.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImmutablePrefixHandler​(@NotNull java.lang.String prefix)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.lang.String getDefaultPrefix()
      Returns the default command prefix of the bot.
      @Nullable java.lang.String getGuildPrefix​(long guildId)
      Returns the prefix, which belongs to the specified guild id.
      void savePrefixes()
      Saves the prefixes
      void setDefaultPrefix​(@NotNull java.lang.String defaultPrefix)
      Sets a new default prefix of the bot.
      void setGuildPrefix​(@NotNull java.lang.String prefix, long guildId)
      Sets a new guild prefix.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImmutablePrefixHandler

        public ImmutablePrefixHandler​(@NotNull
                                      @NotNull java.lang.String prefix)
    • Method Detail

      • getDefaultPrefix

        @NotNull
        public @NotNull java.lang.String getDefaultPrefix()
        Description copied from interface: PrefixHandler
        Returns the default command prefix of the bot.
        Specified by:
        getDefaultPrefix in interface PrefixHandler
        Returns:
        default prefix
      • setDefaultPrefix

        public void setDefaultPrefix​(@NotNull
                                     @NotNull java.lang.String defaultPrefix)
        Description copied from interface: PrefixHandler
        Sets a new default prefix of the bot.
        Specified by:
        setDefaultPrefix in interface PrefixHandler
        Parameters:
        defaultPrefix - prefix
      • getGuildPrefix

        @Nullable
        public @Nullable java.lang.String getGuildPrefix​(long guildId)
        Description copied from interface: PrefixHandler
        Returns the prefix, which belongs to the specified guild id.
        Specified by:
        getGuildPrefix in interface PrefixHandler
        Parameters:
        guildId - the guild id
        Returns:
        guild prefix
      • setGuildPrefix

        public void setGuildPrefix​(@NotNull
                                   @NotNull java.lang.String prefix,
                                   long guildId)
        Description copied from interface: PrefixHandler
        Sets a new guild prefix.
        Specified by:
        setGuildPrefix in interface PrefixHandler
        Parameters:
        prefix - the prefix you want to set
        guildId - the guild id for which you want to set the prefix