Package io.github.chrimle.classforge
Interface Builder<T extends Builder<T>>
- All Known Implementing Classes:
AbstractBuilder,ClassBuilder,EnumBuilder
@API(status=STABLE,
since="0.6.0")
public sealed interface Builder<T extends Builder<T>>
permits AbstractBuilder<T>
Builder of a Java class - which MAY generate a
class, enum or
record.- Since:
- 0.1.0
- Author:
- Chrimle
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe placement of version information in generated classes. -
Method Summary
Modifier and TypeMethodDescriptioncommit()Commits the currently uncommitted changes as a new class.Commits the currently uncommitted changes as a new class.default Tcommit(SemVer.Change change) Commits the currently uncommitted changes as a new class.Gets thesemVerof the currently uncommitted class.Sets thesemVerof the currently uncommitted class.setVersionPlacement(Builder.VersionPlacement versionPlacement) Sets theversionPlacementof the currently uncommitted class.updateClassName(String className) Updates theclassNameof the currently uncommitted class.updateDirectory(String directory) Updates thedirectoryof the currently uncommitted class.updatePackageName(String packageName) Updates thepackageNameof the currently uncommitted class.
-
Method Details
-
setVersionPlacement
Sets theversionPlacementof the currently uncommitted class.Default:
Builder.VersionPlacement.NONE.- Parameters:
versionPlacement- for the class.- Returns:
- this
Builder. - Since:
- 0.3.0
-
getSemVer
SemVer getSemVer()Gets thesemVerof the currently uncommitted class. NOTE: thesemVerwill be updated when committing the changes.- Returns:
- the
semVerof the class. - Since:
- 0.6.0
-
setSemVer
Sets thesemVerof the currently uncommitted class.NOTE: the
semVerwill be updated when committing the changes.- Parameters:
semVer- for the class.- Returns:
- this
Builder. - Since:
- 0.5.0
-
updateDirectory
Updates thedirectoryof the currently uncommitted class.- Parameters:
directory- of the class.- Returns:
- this
Builder. - Since:
- 0.1.0
-
updateClassName
Updates theclassNameof the currently uncommitted class.- Parameters:
className- of the class.- Returns:
- this
Builder. - Since:
- 0.1.0
-
updatePackageName
Updates thepackageNameof the currently uncommitted class.- Parameters:
packageName- of the class.- Returns:
- this
Builder. - Since:
- 0.1.0
-
commit
T commit()Commits the currently uncommitted changes as a new class. ThesemVerof the new class will be set automatically.- Returns:
- this
Builder. - Since:
- 0.1.0
-
commit
Commits the currently uncommitted changes as a new class. ThesemVerof the new class will be set according to the givenchange.- Parameters:
change- for the newsemVer.- Returns:
- this
Builder - Throws:
IllegalArgumentException- ifchangeisnull.- Since:
- 0.6.0
-
commit
Commits the currently uncommitted changes as a new class. ThesemVerof the new class will be set to the givensemVer.- Parameters:
semVer- for the new class.- Returns:
- this
Builder. - Since:
- 0.6.0
-