Module com.github.sormuras.bach
Package com.github.sormuras.bach.project
Record Class DeclaredModule
java.lang.Object
java.lang.Record
com.github.sormuras.bach.project.DeclaredModule
- All Implemented Interfaces:
Comparable<DeclaredModule>
public record DeclaredModule(ModuleDescriptor descriptor, Path info, Optional<String> mainClass, Folders folders)
extends Record
implements Comparable<DeclaredModule>
A module declaration with its possibly targeted folders.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final record -
Constructor Summary
ConstructorsConstructorDescriptionDeclaredModule(ModuleDescriptor descriptor, Path info, Optional<String> mainClass, Folders folders) Creates an instance of aDeclaredModulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(DeclaredModule other) Returns the value of thedescriptorrecord component.final booleanIndicates whether some other object is "equal to" this one.folders()Returns the value of thefoldersrecord component.final inthashCode()Returns a hash code value for this object.info()Returns the value of theinforecord component.Returns the value of themainClassrecord component.name()static DeclaredModulestatic DeclaredModuleof(Path pathOfModuleInfoJavaOrItsParentDirectory, int version, FolderType... types) final StringtoString()Returns a string representation of this record class.withFolder(Path directory, int release, FolderType... types) withMainClass(String name) withResourcesFolder(String directory) withResourcesFolder(String directory, int release) withSourcesFolder(String directory) withSourcesFolder(String directory, int release)
-
Constructor Details
-
DeclaredModule
public DeclaredModule(ModuleDescriptor descriptor, Path info, Optional<String> mainClass, Folders folders) Creates an instance of aDeclaredModulerecord class.- Parameters:
descriptor- the value for thedescriptorrecord componentinfo- the value for theinforecord componentmainClass- the value for themainClassrecord componentfolders- the value for thefoldersrecord component
-
-
Method Details
-
name
-
of
-
of
public static DeclaredModule of(Path pathOfModuleInfoJavaOrItsParentDirectory, int version, FolderType... types) -
compareTo
- Specified by:
compareToin interfaceComparable<DeclaredModule>
-
withMainClass
-
withSourcesFolder
-
withSourcesFolder
-
withResourcesFolder
-
withResourcesFolder
-
withFolder
-
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
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). -
descriptor
Returns the value of thedescriptorrecord component.- Returns:
- the value of the
descriptorrecord component
-
info
Returns the value of theinforecord component.- Returns:
- the value of the
inforecord component
-
mainClass
Returns the value of themainClassrecord component.- Returns:
- the value of the
mainClassrecord component
-
folders
Returns the value of thefoldersrecord component.- Returns:
- the value of the
foldersrecord component
-