Record Class ReplCompileResult
java.lang.Object
java.lang.Record
org.ek9lang.cli.ReplCompileResult
- Record Components:
success- Whether compilation succeededincomplete- Whether input is incomplete (expecting more, like a block body)bytecodeDir- Path to generated bytecode (null if failed)errorOutput- Formatted error messages (empty if successful)
-
Constructor Summary
ConstructorsConstructorDescriptionReplCompileResult(boolean success, boolean incomplete, Path bytecodeDir, String errorOutput) Creates an instance of aReplCompileResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebytecodeDirrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorOutputrecord component.static ReplCompileResultCreate a failed compilation result with a real error.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theincompleterecord component.static ReplCompileResultCreate a result indicating incomplete input (needs continuation).booleansuccess()Returns the value of thesuccessrecord component.static ReplCompileResultCreate a successful compilation result.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ReplCompileResult
Creates an instance of aReplCompileResultrecord class.- Parameters:
success- the value for thesuccessrecord componentincomplete- the value for theincompleterecord componentbytecodeDir- the value for thebytecodeDirrecord componenterrorOutput- the value for theerrorOutputrecord component
-
-
Method Details
-
success
Create a successful compilation result. -
failure
Create a failed compilation result with a real error. -
needsMoreInput
Create a result indicating incomplete input (needs continuation). This is not an error - the parser is expecting more input (like a block body). -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
success
-
incomplete
public boolean incomplete()Returns the value of theincompleterecord component.- Returns:
- the value of the
incompleterecord component
-
bytecodeDir
Returns the value of thebytecodeDirrecord component.- Returns:
- the value of the
bytecodeDirrecord component
-
errorOutput
Returns the value of theerrorOutputrecord component.- Returns:
- the value of the
errorOutputrecord component
-