001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
002 *
003 * Copyright © 2023–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.reference;
015
016import org.microbean.bean.Id;
017
018/**
019 * A facility for removing contextual instances from some kind of storage.
020 *
021 * @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a>
022 */
023@FunctionalInterface
024public interface InstanceRemover {
025
026  /**
027   * Removes the contextual instance indexed under the supplied {@link Id}.
028   *
029   * @param id an {@link Id}; may be {@code null} in which case {@code false} will be returned
030   *
031   * @return {@code true} if removal successfully took place; {@code false} otherwise
032   */
033  public boolean remove(final Id id);
034
035}