Package net.bonn2.modules.settings.types
Class Setting
java.lang.Object
net.bonn2.modules.settings.types.Setting
- Direct Known Subclasses:
BooleanSetting,DoubleSetting,FloatSetting,IntSetting,MessageChannelListSetting,MessageChannelSetting,RoleListSetting,RoleSetting,StringSetting
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SettingfromJson(@NotNull com.google.gson.JsonElement element) booleandoublefloatintgetAsInt()net.dv8tion.jda.api.entities.channel.middleman.MessageChannelgetAsMessageChannel(net.dv8tion.jda.api.entities.Guild guild) List<net.dv8tion.jda.api.entities.channel.middleman.MessageChannel>getAsMessageChannelList(net.dv8tion.jda.api.entities.Guild guild) net.dv8tion.jda.api.entities.RolegetAsRole(net.dv8tion.jda.api.entities.Guild guild) List<net.dv8tion.jda.api.entities.Role>getAsRoleList(net.dv8tion.jda.api.entities.Guild guild) abstract Stringstatic Settingof(@NotNull String value, Setting.Type type) Creates a setting of type-type with the value-valueabstract com.google.gson.JsonElementtoJson()
-
Constructor Details
-
Setting
public Setting()
-
-
Method Details
-
toJson
public abstract com.google.gson.JsonElement toJson() -
fromJson
- Parameters:
element- Must be a string in the form `type:value`- Returns:
- A setting object of the correct type
-
of
Creates a setting of type-type with the value-value- Parameters:
value- A string representation of the value to settype- The type of setting to create- Returns:
- The setting or null if unknown type
-
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
-
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
-
getAsString
-
getAsBoolean
public boolean getAsBoolean()
-