Record Class Metadata
java.lang.Object
java.lang.Record
org.matwoess.jsourceprofiler.tool.model.Metadata
- Record Components:
blocksCount- the total number of blocks found in the projectjavaFiles- the list of java files in the project
Helper class to represent the metadata of a java project.
Contains the total number of blocks and the list of java files and their respective JavaFile objects.
Includes methods to export and import the metadata to/from a file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theblocksCountrecord component.final booleanIndicates whether some other object is "equal to" this one.voidexportMetadata(Path metadataPath) Exports the metadata to the filesystem.final inthashCode()Returns a hash code value for this object.static MetadataimportMetadata(Path metadataPath) Imports the metadata from the filesystem.JavaFile[]Returns the value of thejavaFilesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Metadata
Creates an instance of aMetadatarecord class.- Parameters:
blocksCount- the value for theblocksCountrecord componentjavaFiles- the value for thejavaFilesrecord component
-
-
Method Details
-
exportMetadata
Exports the metadata to the filesystem.The metadata file is located at
IO.getMetadataPath().- Parameters:
metadataPath- the path to the metadata file
-
importMetadata
Imports the metadata from the filesystem.The metadata file is located at
IO.getMetadataPath().- Parameters:
metadataPath- the path to the metadata file- Returns:
- a new
Metadataobject read from a file
-
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 '=='. -
blocksCount
public int blocksCount()Returns the value of theblocksCountrecord component.- Returns:
- the value of the
blocksCountrecord component
-
javaFiles
Returns the value of thejavaFilesrecord component.- Returns:
- the value of the
javaFilesrecord component
-