001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*- 002 * 003 * Copyright © 2024–2025 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.bean; 015 016import java.util.Objects; 017 018/** 019 * A pairing of an {@link AttributedType} and a {@link Bean} resulting from a reduction. 020 * 021 * @param <I> the type of contextual instances the supplied {@link Bean} is capable of creating 022 * 023 * @param attributedType an {@link AttributedType} 024 * 025 * @param bean a {@link Bean} deemed suitable for the {@code attributedType} 026 * 027 * @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a> 028 */ 029public final record BeanReduction<I>(AttributedType attributedType, Bean<I> bean) { 030 031 /** 032 * Creates a new {@link BeanReduction}. 033 * 034 * @param attributedType an {@link AttributedType}; must not be {@code null} 035 * 036 * @param bean a {@link Bean} deemed suitable for the {@code attributedType}; must not be {@code null} 037 */ 038 public BeanReduction { 039 Objects.requireNonNull(attributedType, "attributedType"); 040 Objects.requireNonNull(bean, "bean"); 041 } 042 043}