Package me.a8kj.config.file.impl
Record Class BasicConfigFile<K>
java.lang.Object
java.lang.Record
me.a8kj.config.file.impl.BasicConfigFile<K>
- Type Parameters:
K- the type of data keys used in the configuration.- Record Components:
meta- the metadata defining the configuration's identity and behavior.file- the physical file representation on the system.memory- the data structure used for in-memory storage and manipulation. * @author a8kj7sea
- All Implemented Interfaces:
ConfigFile<K>
public record BasicConfigFile<K>(ConfigMeta meta, File file, DataMemory<K> memory)
extends Record
implements ConfigFile<K>
A fundamental implementation of
ConfigFile using Java Records.
This record serves as an immutable container for configuration components,
ensuring a consistent state between metadata, physical storage, and memory.- Since:
- 0.1
-
Constructor Summary
ConstructorsConstructorDescriptionBasicConfigFile(ConfigMeta meta, File file, DataMemory<K> memory) Creates an instance of aBasicConfigFilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.final inthashCode()Returns a hash code value for this object.memory()Returns the value of thememoryrecord component.meta()Returns the value of themetarecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
meta
Returns the value of themetarecord component.- Specified by:
metain interfaceConfigFile<K>- Returns:
- the value of the
metarecord component
-
file
Returns the value of thefilerecord component.- Specified by:
filein interfaceConfigFile<K>- Returns:
- the value of the
filerecord component
-
memory
Returns the value of thememoryrecord component.- Specified by:
memoryin interfaceConfigFile<K>- Returns:
- the value of the
memoryrecord component
-