Record Class TestDirective
java.lang.Object
java.lang.Record
org.ek9lang.compiler.directives.TestDirective
- Record Components:
token- Source location of the directivegroup- Optional group name for sequential execution (null = parallel)lineNumber- The line number the directive applies to (the program declaration line)
- All Implemented Interfaces:
Directive
public record TestDirective(IToken token, String group, int lineNumber)
extends Record
implements Directive
Test directive for marking programs as tests.
Used to mark programs as tests for the test runner.
@Test- Parallel test (no group)@Test: "database" - Group name for sequential execution within group
-
Constructor Summary
ConstructorsConstructorDescriptionTestDirective(IToken token, String group, int lineNumber) Creates an instance of aTestDirectiverecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intWhich line number does this directive apply to.Provide a token from the source, by default if not possible supply synthetic.group()Returns the value of thegrouprecord component.booleanhasGroup()Check if this test has a group for sequential execution.final inthashCode()Returns a hash code value for this object.booleanisForPhase(CompilationPhase phase) Is it for the particular compiler phase.intReturns the value of thelineNumberrecord component.token()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.type()What s the type of the directive.
-
Constructor Details
-
TestDirective
Creates an instance of aTestDirectiverecord class.- Parameters:
token- the value for thetokenrecord componentgroup- the value for thegrouprecord componentlineNumber- the value for thelineNumberrecord component
-
-
Method Details
-
type
Description copied from interface:DirectiveWhat s the type of the directive. -
isForPhase
Description copied from interface:DirectiveIs it for the particular compiler phase.- Specified by:
isForPhasein interfaceDirective
-
getAppliesToLineNumber
public int getAppliesToLineNumber()Description copied from interface:DirectiveWhich line number does this directive apply to.- Specified by:
getAppliesToLineNumberin interfaceDirective
-
getDirectiveToken
Description copied from interface:DirectiveProvide a token from the source, by default if not possible supply synthetic.- Specified by:
getDirectiveTokenin interfaceDirective
-
hasGroup
public boolean hasGroup()Check if this test has a group for sequential execution. -
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. -
token
-
group
-
lineNumber
public int lineNumber()Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-