- 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=MAINTAINED,
since="5.13.3")
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 StringgetName()Get the name of the payload.default ExecutableGet the payload.Methods inherited from interface org.junit.jupiter.api.function.Executable
execute
-
Method Details
-
getName
Description copied from interface:NamedGet the name of the payload.- Specified by:
getNamein interfaceNamed<Executable>- Returns:
- the name of the payload; never
nullor blank
-
getPayload
Description copied from interface:NamedGet the payload.- Specified by:
getPayloadin interfaceNamed<Executable>- Returns:
- the payload; may be
nulldepending on the use case
-