Record Class SettingDescriptor
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.settings.SettingDescriptor
- Record Components:
id- the setting's ID in the settings menupath- its path insettings.yml, such ascornucopia.enabledtype- the kind of value it holdsminimum- the smallest accepted number, forSettingDescriptor.Type.INTEGERandSettingDescriptor.Type.DECIMALmaximum- the largest accepted number, forSettingDescriptor.Type.INTEGERandSettingDescriptor.Type.DECIMALstep- the menu's step size, for numbersallowedValues- the accepted values, forSettingDescriptor.Type.ENUM; empty otherwise
public record SettingDescriptor(@NotNull String id, @NotNull String path, @NotNull SettingDescriptor.Type type, double minimum, double maximum, double step, @NotNull List<String> allowedValues)
extends Record
One
settings.yml value Zentrix lets administrators edit in its settings menu, and
therefore lets addons edit through SettingsService.- Since:
- 1.8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of value a setting holds, and the Java valueSettingsService.set(java.lang.String, java.lang.Object)expects. -
Constructor Summary
ConstructorsConstructorDescriptionSettingDescriptor(@NotNull String id, @NotNull String path, @NotNull SettingDescriptor.Type type, double minimum, double maximum, double step, @NotNull List<String> allowedValues) Creates an instance of aSettingDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedValuesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.doublemaximum()Returns the value of themaximumrecord component.doubleminimum()Returns the value of theminimumrecord component.@NotNull Stringpath()Returns the value of thepathrecord component.doublestep()Returns the value of thesteprecord component.final StringtoString()Returns a string representation of this record class.@NotNull SettingDescriptor.Typetype()Returns the value of thetyperecord component.
-
Constructor Details
-
SettingDescriptor
public SettingDescriptor(@NotNull @NotNull String id, @NotNull @NotNull String path, @NotNull @NotNull SettingDescriptor.Type type, double minimum, double maximum, double step, @NotNull @NotNull List<String> allowedValues) Creates an instance of aSettingDescriptorrecord class.- Parameters:
id- the value for theidrecord componentpath- the value for thepathrecord componenttype- the value for thetyperecord componentminimum- the value for theminimumrecord componentmaximum- the value for themaximumrecord componentstep- the value for thesteprecord componentallowedValues- the value for theallowedValuesrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
minimum
public double minimum()Returns the value of theminimumrecord component.- Returns:
- the value of the
minimumrecord component
-
maximum
public double maximum()Returns the value of themaximumrecord component.- Returns:
- the value of the
maximumrecord component
-
step
public double step()Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-
allowedValues
Returns the value of theallowedValuesrecord component.- Returns:
- the value of the
allowedValuesrecord component
-