Package cs1302.tracer
Record Class CompilationHelper.CompilationResult
java.lang.Object
java.lang.Record
cs1302.tracer.CompilationHelper.CompilationResult
- Record Components:
classPath- Root of the class path where compiled classes were output.compiledClassNames- Binary names of the classes that were compiled.mainClass- Binary name of the class that contains the main method.sourceRoot- The source root used during compilation, if any.previewEnabled- True if preview features were enabled during compilation.
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
CompilationHelper
public static record CompilationHelper.CompilationResult(Path classPath, Set<String> compiledClassNames, String mainClass, Optional<Path> sourceRoot, boolean previewEnabled)
extends Record
implements AutoCloseable
A collection of information from the successful compilation of a Java program.
-
Constructor Summary
ConstructorsConstructorDescriptionCompilationResult(Path classPath, Set<String> compiledClassNames, String mainClass) Constructs a CompilationResult without an explicit source root.CompilationResult(Path classPath, Set<String> compiledClassNames, String mainClass, Optional<Path> sourceRoot) Constructs a CompilationResult with an explicit source root.CompilationResult(Path classPath, Set<String> compiledClassNames, String mainClass, Optional<Path> sourceRoot, boolean previewEnabled) Creates an instance of aCompilationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclassPathrecord component.voidclose()Returns the value of thecompiledClassNamesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themainClassrecord component.booleanReturns the value of thepreviewEnabledrecord component.Returns the value of thesourceRootrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompilationResult
public CompilationResult(Path classPath, Set<String> compiledClassNames, String mainClass, Optional<Path> sourceRoot) Constructs a CompilationResult with an explicit source root.- Parameters:
classPath- Class output path.compiledClassNames- Set of compiled class names.mainClass- Main entry class name.sourceRoot- Source root path.
-
CompilationResult
Constructs a CompilationResult without an explicit source root.- Parameters:
classPath- Class output path.compiledClassNames- Set of compiled class names.mainClass- Main entry class name.
-
CompilationResult
public CompilationResult(Path classPath, Set<String> compiledClassNames, String mainClass, Optional<Path> sourceRoot, boolean previewEnabled) Creates an instance of aCompilationResultrecord class.- Parameters:
classPath- the value for theclassPathrecord componentcompiledClassNames- the value for thecompiledClassNamesrecord componentmainClass- the value for themainClassrecord componentsourceRoot- the value for thesourceRootrecord componentpreviewEnabled- the value for thepreviewEnabledrecord component
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
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 '=='. -
classPath
Returns the value of theclassPathrecord component.- Returns:
- the value of the
classPathrecord component
-
compiledClassNames
Returns the value of thecompiledClassNamesrecord component.- Returns:
- the value of the
compiledClassNamesrecord component
-
mainClass
Returns the value of themainClassrecord component.- Returns:
- the value of the
mainClassrecord component
-
sourceRoot
Returns the value of thesourceRootrecord component.- Returns:
- the value of the
sourceRootrecord component
-
previewEnabled
public boolean previewEnabled()Returns the value of thepreviewEnabledrecord component.- Returns:
- the value of the
previewEnabledrecord component
-