001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.oscal.lib.model.control.catalog;
007
008import java.util.List;
009import java.util.stream.Stream;
010
011import dev.metaschema.oscal.lib.model.Control;
012import dev.metaschema.oscal.lib.model.Parameter;
013import edu.umd.cs.findbugs.annotations.NonNull;
014
015public interface IControlContainer {
016
017  List<Control> getControls();
018
019  /**
020   * Add a new {@link Control} item to the end of the underlying collection.
021   *
022   * @param item
023   *          the item to add
024   * @return {@code true}
025   */
026  boolean addControl(@NonNull Control item);
027
028  /**
029   * Remove the first matching {@link Control} item from the underlying
030   * collection.
031   *
032   * @param item
033   *          the item to remove
034   * @return {@code true} if the item was removed or {@code false} otherwise
035   */
036  boolean removeControl(@NonNull Control item);
037
038  List<Parameter> getParams();
039
040  /**
041   * Add a new {@link Parameter} item to the underlying collection.
042   *
043   * @param item
044   *          the item to add
045   * @return {@code true}
046   */
047  boolean addParam(@NonNull Parameter item);
048
049  /**
050   * Remove the first matching {@link Parameter} item from the underlying
051   * collection.
052   *
053   * @param item
054   *          the item to remove
055   * @return {@code true} if the item was removed or {@code false} otherwise
056   */
057  boolean removeParam(@NonNull Parameter item);
058
059  /**
060   * Get the parameter identifiers referenced in the object's context, but not by
061   * their child objects.
062   *
063   * @return a stream of identifiers
064   */
065  Stream<String> getReferencedParameterIds();
066}