Record Class GeneratedFile
java.lang.Object
java.lang.Record
com.pragma.archetype.domain.model.file.GeneratedFile
Represents a file to be generated.
Uses Java 21 record for immutability.
-
Constructor Summary
ConstructorsConstructorDescriptionGeneratedFile(Path path, String content, FileType type) Creates an instance of aGeneratedFilerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.static GeneratedFileCreates a generic file with automatic type detection.final booleanIndicates whether some other object is "equal to" this one.static GeneratedFilegradleBuild(Path path, String content) Creates a Gradle build file.final inthashCode()Returns a hash code value for this object.static GeneratedFilejavaSource(Path path, String content) Creates a Java source file.static GeneratedFileCreates a markdown file.path()Returns the value of thepathrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.static GeneratedFileyamlConfig(Path path, String content) Creates a YAML configuration file.
-
Constructor Details
-
GeneratedFile
Creates an instance of aGeneratedFilerecord class.- Parameters:
path- the value for thepathrecord componentcontent- the value for thecontentrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
javaSource
Creates a Java source file. -
gradleBuild
Creates a Gradle build file. -
yamlConfig
Creates a YAML configuration file. -
markdown
Creates a markdown file. -
create
Creates a generic file with automatic type detection. -
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). -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-