Record Class ConfigSyncModification<T>
java.lang.Object
java.lang.Record
net.frozenblock.lib.config.impl.network.ConfigSyncModification<T>
- All Implemented Interfaces:
Consumer<T>
public record ConfigSyncModification<T>(Config<T> config, ConfigSyncModification.DataSupplier<T> dataSupplier)
extends Record
implements Consumer<T>
- Since:
- 1.5
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConfigSyncModification(Config<T> config, ConfigSyncModification.DataSupplier<T> dataSupplier) Creates an instance of aConfigSyncModificationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcanModifyField(@Nullable Field field, @Nullable Config<?> config) config()Returns the value of theconfigrecord component.Returns the value of thedataSupplierrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static booleanisLockedWhenSynced(@NotNull Field field) static booleanisSyncable(@NotNull Field field) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConfigSyncModification
public ConfigSyncModification(Config<T> config, ConfigSyncModification.DataSupplier<T> dataSupplier) Creates an instance of aConfigSyncModificationrecord class.- Parameters:
config- the value for theconfigrecord componentdataSupplier- the value for thedataSupplierrecord component
-
-
Method Details
-
accept
-
isSyncable
-
isLockedWhenSynced
-
canModifyField
@Environment(CLIENT) public static ConfigModification.EntryPermissionType canModifyField(@Nullable @Nullable Field field, @Nullable @Nullable Config<?> config) -
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). -
config
Returns the value of theconfigrecord component.- Returns:
- the value of the
configrecord component
-
dataSupplier
Returns the value of thedataSupplierrecord component.- Returns:
- the value of the
dataSupplierrecord component
-