1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.core.model;
7   
8   import java.util.Collection;
9   
10  import javax.xml.namespace.QName;
11  
12  /**
13   * Common interface for model container support classes.
14   *
15   * @param <MI>
16   *          the model instance Java type
17   * @param <NMI>
18   *          the named model instance Java type
19   * @param <FI>
20   *          the field instance Java type
21   * @param <AI>
22   *          the assembly instance Java type
23   */
24  public interface IFeatureContainerModelAbsolute<
25      MI extends IModelInstanceAbsolute,
26      NMI extends INamedModelInstanceAbsolute,
27      FI extends IFieldInstanceAbsolute,
28      AI extends IAssemblyInstanceAbsolute>
29      extends IContainerModelAbsolute, IFeatureContainerModel<MI, NMI, FI, AI> {
30    @Override
31    default Collection<MI> getModelInstances() {
32      return getModelContainer().getModelInstances();
33    }
34  
35    @Override
36    default NMI getNamedModelInstanceByName(QName name) {
37      return getModelContainer().getNamedModelInstanceMap().get(name);
38    }
39  
40    @SuppressWarnings("null")
41    @Override
42    default Collection<NMI> getNamedModelInstances() {
43      return getModelContainer().getNamedModelInstanceMap().values();
44    }
45  
46    @Override
47    default FI getFieldInstanceByName(QName name) {
48      return getModelContainer().getFieldInstanceMap().get(name);
49    }
50  
51    @SuppressWarnings("null")
52    @Override
53    default Collection<FI> getFieldInstances() {
54      return getModelContainer().getFieldInstanceMap().values();
55    }
56  
57    @Override
58    default AI getAssemblyInstanceByName(QName name) {
59      return getModelContainer().getAssemblyInstanceMap().get(name);
60    }
61  
62    @SuppressWarnings("null")
63    @Override
64    default Collection<AI> getAssemblyInstances() {
65      return getModelContainer().getAssemblyInstanceMap().values();
66    }
67  }