public static final class AbstractApplication.Setting
extends java.lang.Object
Setting represents a setting that can be enabled or disabled.| Constructor and Description |
|---|
Setting(java.lang.String name)
Constructs a new
Setting instance. |
Setting(java.lang.String name,
boolean isEnabled)
Constructs a new
Setting instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
disable()
Disables this
Setting instance. |
void |
enable()
Enables this
Setting instance. |
boolean |
equals(java.lang.Object object)
Compares
object to this Setting instance for equality. |
java.lang.String |
getName()
Returns the name of this
Setting instance. |
int |
hashCode()
Returns a hash code for this
Setting instance. |
boolean |
isDisabled()
Returns
true if, and only if, this Setting is disabled, false otherwise. |
boolean |
isEnabled()
Returns
true if, and only if, this Setting is enabled, false otherwise. |
void |
set(boolean isEnabled)
Enables or disables this
Setting instance. |
void |
toggle()
Toggles this
Setting instance. |
java.lang.String |
toString()
Returns a
String representation of this Setting instance. |
public Setting(java.lang.String name)
Setting instance.
Calling this constructor is equivalent to calling new Setting(name, false).
If name is null, a NullPointerException will be thrown.
name - the name to usejava.lang.NullPointerException - thrown if, and only if, name is nullpublic Setting(java.lang.String name,
boolean isEnabled)
Setting instance.
If name is null, a NullPointerException will be thrown.
name - the name to useisEnabled - true if enabled, false otherwisejava.lang.NullPointerException - thrown if, and only if, name is nullpublic java.lang.String getName()
Setting instance.Setting instancepublic java.lang.String toString()
String representation of this Setting instance.toString in class java.lang.ObjectString representation of this Setting instancepublic boolean equals(java.lang.Object object)
object to this Setting instance for equality.
Returns true if, and only if, object is an instance of Setting, and their respective values are equal, false otherwise.
equals in class java.lang.Objectobject - the Object to compare to this Setting instance for equalitytrue if, and only if, object is an instance of Setting, and their respective values are equal, false otherwisepublic boolean isDisabled()
true if, and only if, this Setting is disabled, false otherwise.true if, and only if, this Setting is disabled, false otherwisepublic boolean isEnabled()
true if, and only if, this Setting is enabled, false otherwise.true if, and only if, this Setting is enabled, false otherwisepublic int hashCode()
Setting instance.hashCode in class java.lang.ObjectSetting instancepublic void disable()
Setting instance.public void enable()
Setting instance.public void set(boolean isEnabled)
Setting instance.isEnabled - true if enabled, false otherwisepublic void toggle()
Setting instance.