Package com.alfakynz.nomorepopups.config
Record Class ConfigSettings.Setting
java.lang.Object
java.lang.Record
com.alfakynz.nomorepopups.config.ConfigSettings.Setting
- Enclosing class:
- ConfigSettings
public static record ConfigSettings.Setting(String key, BooleanSupplier getter, Consumer<Boolean> setter, boolean defaultValue)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSetting(String key, BooleanSupplier getter, Consumer<Boolean> setter, boolean defaultValue) Creates an instance of aSettingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thedefaultValuerecord component.final booleanIndicates whether some other object is "equal to" this one.getter()Returns the value of thegetterrecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.setter()Returns the value of thesetterrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Setting
Creates an instance of aSettingrecord class.- Parameters:
key- the value for thekeyrecord componentgetter- the value for thegetterrecord componentsetter- the value for thesetterrecord componentdefaultValue- the value for thedefaultValuerecord 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 '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
getter
Returns the value of thegetterrecord component.- Returns:
- the value of the
getterrecord component
-
setter
Returns the value of thesetterrecord component.- Returns:
- the value of the
setterrecord component
-
defaultValue
public boolean defaultValue()Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-