All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fnproject.springframework.function.functions.SpringCloudFunction Maven / Gradle / Ivy

There is a newer version: 1.0.196
Show newest version
package com.fnproject.springframework.function.functions;

import org.springframework.cloud.function.context.catalog.FunctionInspector;
import reactor.core.publisher.Flux;

import java.util.function.Function;

/**
 * {@link SpringCloudMethod} representing a {@link Function}
 */
public class SpringCloudFunction extends SpringCloudMethod {
    private Function, Flux> function;

    public SpringCloudFunction(Function, Flux> function, FunctionInspector inspector) {
        super(inspector);
        this.function = function;
    }

    @Override
    protected String getMethodName() {
        return "apply";
    }

    @Override
    protected Object getFunction() {
        return function;
    }

    @Override
    public Flux invoke(Flux arg) {
        return function.apply(arg);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy