Record Class FormatterResult
java.lang.Object
java.lang.Record
org.ek9lang.compiler.formatter.FormatterResult
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe state of the formatter after processing. -
Constructor Summary
ConstructorsConstructorDescriptionFormatterResult(FormatterResult.FormatterState state, String output, List<String> corrections, List<String> errors) Creates an instance of aFormatterResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecorrectionsrecord component.final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.static FormatterResultCreate a failed formatting result.final inthashCode()Returns a hash code value for this object.booleanCheck if the formatting was successful.output()Returns the value of theoutputrecord component.state()Returns the value of thestaterecord component.static FormatterResultCreate a successful formatting result.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FormatterResult
public FormatterResult(FormatterResult.FormatterState state, String output, List<String> corrections, List<String> errors) Creates an instance of aFormatterResultrecord class.- Parameters:
state- the value for thestaterecord componentoutput- the value for theoutputrecord componentcorrections- the value for thecorrectionsrecord componenterrors- the value for theerrorsrecord component
-
-
Method Details
-
success
Create a successful formatting result. -
failure
Create a failed formatting result. -
isSuccess
public boolean isSuccess()Check if the formatting was successful. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
corrections
-
errors
-