Interface NamedExecutable

  • 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:
    DynamicTest.stream(Stream), DynamicTest.stream(Iterator)
    • Method Detail

      • getName

        default java.lang.String getName()
        Description copied from interface: Named
        Get the name of the payload.
        Specified by:
        getName in interface Named<Executable>
        Returns:
        the name of the payload; never null or blank
      • getPayload

        default Executable getPayload()
        Description copied from interface: Named
        Get the payload.
        Specified by:
        getPayload in interface Named<Executable>
        Returns:
        the payload; may be null depending on the use case