001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*- 002 * 003 * Copyright © 2024 microBean™. 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 006 * the License. You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 011 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 012 * specific language governing permissions and limitations under the License. 013 */ 014package org.microbean.interceptor; 015 016/** 017 * A {@linkplain FunctionalInterface functional interface} whose implementations represent an interception of some kind. 018 * 019 * @author <a href="https://about.me/lairdnelson/" target="_top">Laird Nelson</a> 020 * 021 * @see #apply(Object...) 022 */ 023@FunctionalInterface 024public interface InterceptionFunction { 025 026 /** 027 * Applies the interception represented by this {@link InterceptionFunction}, with the supplied arguments, and returns 028 * the result. 029 * 030 * @param arguments arguments to the interception; must not be a {@code null} array 031 * 032 * @return the result of the interception, which may be {@code null} 033 * 034 * @exception NullPointerException if {@code arguments} is a {@code null} array 035 * 036 * @see Interceptions 037 */ 038 public Object apply(final Object... arguments); 039 040}