com.vaadin.server.SerializableFunction Maven / Gradle / Ivy
/*
* Copyright (C) 2000-2024 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.server;
import java.io.Serializable;
import java.util.function.Function;
/**
* A {@link Function} that is also {@link Serializable}.
*
* @see Function
* @author Vaadin Ltd
* @since 8.0
* @param
* the type of the input to the function
* @param
* the type of the result of the function
*/
@FunctionalInterface
public interface SerializableFunction
extends Function, Serializable {
/**
* Returns a function that always returns its input argument.
*
* @param
* the type of the input and output objects to the function
* @return a function that always returns its input argument
*/
static SerializableFunction identity() {
return t -> t;
}
}