
com.github.dakusui.valid8j_pcond.experimentals.currying.multi.MultiFunction Maven / Gradle / Ivy
The newest version!
package com.github.dakusui.valid8j_pcond.experimentals.currying.multi;
import com.github.dakusui.valid8j_pcond.core.printable.PrintableFunction;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Supplier;
import static com.github.dakusui.valid8j_pcond.internals.InternalChecks.requireArgumentListSize;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.joining;
/**
* An interface that represents a function that can have more than one parameters.
* This interface is often used in combination with {@link com.github.dakusui.valid8j_pcond.forms.Functions#curry(MultiFunction)} method.
*
* @param The type of the returned value.
*/
public interface MultiFunction extends Function, R> {
/**
* Returns a name of this function.
*
* @return The name of this function.
*/
String name();
/**
* Returns the number of parameters that this function can take.
*
* @return the number of parameters
*/
int arity();
/**
* The expected type of the {@code i}th parameter.
*
* @param i The parameter index.
* @return The type of {@code i}th parameter.
*/
Class> parameterType(int i);
/**
* The type of the value returned by this function.
*
* @return The type of the returned value.
*/
Class extends R> returnType();
class Impl extends PrintableFunction, R> implements MultiFunction {
private final String name;
private final List> parameterTypes;
protected Impl(
Object creator,
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy