• Prepares a given method call by:

    • Extracting a functional interface.
    • Creating a field of that type.
    • Initializing the field with the called method.
    • Replacing the call with invocation of the field method.

    Parameters

    • call: undefined | null | Call

      The method call join point.

    • Optionalmethod: Method

      The method join point (optional).

    • OptionalfieldLocation: Class

      The location to insert the field (optional).

    • newFile: boolean = true

      Whether to create the interface in a new file (default: true).

    • funcInterface: undefined | null | InterfaceType = null

      The functional interface join point (optional).

    Returns {
        $field: Field | undefined | null;
        $interface: InterfaceType | null;
        $interfaceMethod: Method | undefined;
        defaultMethod: string | undefined;
    }

    An object containing the extracted field, interface, and related information.

    • $field: Field | undefined | null
    • $interface: InterfaceType | null
    • $interfaceMethod: Method | undefined
    • defaultMethod: string | undefined