- All Superinterfaces:
Executable
,Named<Executable>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@API(status=EXPERIMENTAL,
since="5.11")
public interface NamedExecutable
extends Named<Executable>, Executable
NamedExecutable
joins Executable
and Named
in a
one self-typed functional interface.
The default implementation of getName()
returns the result of
calling Object.toString()
on the implementing instance but may be
overridden by concrete implementations to provide a more meaningful name.
On Java 16 or later, it is recommended to implement this interface using a record type.
- Since:
- 5.11
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
getName()
Get the name of the payload.default Executable
Get the payload.Methods inherited from interface org.junit.jupiter.api.function.Executable
execute
-
Method Details
-
getName
Description copied from interface:Named
Get the name of the payload.- Specified by:
getName
in interfaceNamed<Executable>
- Returns:
- the name of the payload; never
null
or blank
-
getPayload
Description copied from interface:Named
Get the payload.- Specified by:
getPayload
in interfaceNamed<Executable>
- Returns:
- the payload; may be
null
depending on the use case
-