Record Class SettingChangeResult
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.settings.SettingChangeResult
- Record Components:
status- what happenedvalue- the value now stored, as Zentrix normalised it; null unless it was savedreason- why the value was refused, forSettingChangeResult.Status.INVALID; empty otherwise
public record SettingChangeResult(@NotNull SettingChangeResult.Status status, @Nullable Object value, @NotNull String reason)
extends Record
The outcome of
SettingsService.set(java.lang.String, java.lang.Object).- Since:
- 1.8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat a setting change did. -
Constructor Summary
ConstructorsConstructorDescriptionSettingChangeResult(@NotNull SettingChangeResult.Status status, @Nullable Object value, @NotNull String reason) Creates an instance of aSettingChangeResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getValue()The stored value, when it was saved.final inthashCode()Returns a hash code value for this object.booleanisSaved()Whether the value is insettings.ymlnow.@NotNull Stringreason()Returns the value of thereasonrecord component.@NotNull SettingChangeResult.Statusstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.@Nullable Objectvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
SettingChangeResult
public SettingChangeResult(@NotNull @NotNull SettingChangeResult.Status status, @Nullable @Nullable Object value, @NotNull @NotNull String reason) Creates an instance of aSettingChangeResultrecord class.
-
-
Method Details
-
getValue
The stored value, when it was saved. -
isSaved
public boolean isSaved()Whether the value is insettings.ymlnow. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-