1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.oscal.lib.model.control.catalog;
7   
8   import gov.nist.secauto.oscal.lib.model.Control;
9   import gov.nist.secauto.oscal.lib.model.Parameter;
10  
11  import java.util.List;
12  import java.util.stream.Stream;
13  
14  import edu.umd.cs.findbugs.annotations.NonNull;
15  
16  public interface IControlContainer {
17  
18    List<Control> getControls();
19  
20    /**
21     * Add a new {@link Control} item to the end of the underlying collection.
22     *
23     * @param item
24     *          the item to add
25     * @return {@code true}
26     */
27    boolean addControl(@NonNull Control item);
28  
29    /**
30     * Remove the first matching {@link Control} item from the underlying
31     * collection.
32     *
33     * @param item
34     *          the item to remove
35     * @return {@code true} if the item was removed or {@code false} otherwise
36     */
37    boolean removeControl(@NonNull Control item);
38  
39    List<Parameter> getParams();
40  
41    /**
42     * Add a new {@link Parameter} item to the underlying collection.
43     *
44     * @param item
45     *          the item to add
46     * @return {@code true}
47     */
48    boolean addParam(@NonNull Parameter item);
49  
50    /**
51     * Remove the first matching {@link Parameter} item from the underlying
52     * collection.
53     *
54     * @param item
55     *          the item to remove
56     * @return {@code true} if the item was removed or {@code false} otherwise
57     */
58    boolean removeParam(@NonNull Parameter item);
59  
60    /**
61     * Get the parameter identifiers referenced in the object's context, but not by
62     * their child objects.
63     *
64     * @return a stream of identifiers
65     */
66    Stream<String> getReferencedParameterIds();
67  }