Class Setting

java.lang.Object
net.bonn2.modules.settings.types.Setting
Direct Known Subclasses:
BooleanSetting, DoubleSetting, FloatSetting, IntSetting, MessageChannelListSetting, MessageChannelSetting, RoleListSetting, RoleSetting, StringSetting

public abstract class Setting extends Object
  • Constructor Details

    • Setting

      public Setting()
  • Method Details

    • toJson

      public abstract com.google.gson.JsonElement toJson()
    • fromJson

      public static Setting fromJson(@NotNull @NotNull com.google.gson.JsonElement element)
      Parameters:
      element - Must be a string in the form `type:value`
      Returns:
      A setting object of the correct type
    • of

      public static Setting of(@NotNull @NotNull String value, Setting.Type type)
      Creates a setting of type-type with the value-value
      Parameters:
      value - A string representation of the value to set
      type - The type of setting to create
      Returns:
      The setting or null if unknown type
    • getDisplayString

      public abstract String getDisplayString()
    • getAsDouble

      public double getAsDouble()
    • getAsInt

      public int getAsInt()
    • getAsFloat

      public float getAsFloat()
    • getAsRole

      public net.dv8tion.jda.api.entities.Role getAsRole(net.dv8tion.jda.api.entities.Guild guild)
    • getAsRoleList

      public List<net.dv8tion.jda.api.entities.Role> getAsRoleList(net.dv8tion.jda.api.entities.Guild guild)
    • getAsRoleIdList

      public List<String> getAsRoleIdList()
    • getAsMessageChannel

      public net.dv8tion.jda.api.entities.channel.middleman.MessageChannel getAsMessageChannel(net.dv8tion.jda.api.entities.Guild guild)
    • getAsMessageChannelList

      public List<net.dv8tion.jda.api.entities.channel.middleman.MessageChannel> getAsMessageChannelList(net.dv8tion.jda.api.entities.Guild guild)
    • getAsChannelIdList

      public List<String> getAsChannelIdList()
    • getAsString

      public String getAsString()
    • getAsBoolean

      public boolean getAsBoolean()