001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.core.model;
007
008import java.util.List;
009import java.util.Map;
010
011import edu.umd.cs.findbugs.annotations.NonNull;
012
013/**
014 * Provides assembly-specific container model functionality through delegation.
015 * <p>
016 * This interface extends absolute container model features with
017 * assembly-specific capabilities, including choice and choice group instances.
018 * Implementations delegate to an {@link IContainerModelAssemblySupport}
019 * instance.
020 *
021 * @param <MI>
022 *          the Java type of model instances
023 * @param <NMI>
024 *          the Java type of named model instances
025 * @param <FI>
026 *          the Java type of field instances
027 * @param <AI>
028 *          the Java type of assembly instances
029 * @param <CI>
030 *          the Java type of choice instances
031 * @param <CGI>
032 *          the Java type of choice group instances
033 */
034public interface IFeatureContainerModelAssembly<
035    MI extends IModelInstanceAbsolute,
036    NMI extends INamedModelInstanceAbsolute,
037    FI extends IFieldInstanceAbsolute,
038    AI extends IAssemblyInstanceAbsolute,
039    CI extends IChoiceInstance,
040    CGI extends IChoiceGroupInstance>
041    extends IContainerModelAssembly,
042    IFeatureContainerModelAbsolute<MI, NMI, FI, AI> {
043  /**
044   * Get the model container implementation instance.
045   *
046   * @return the model container instance
047   */
048  @Override
049  @NonNull
050  IContainerModelAssemblySupport<MI, NMI, FI, AI, CI, CGI> getModelContainer();
051
052  @Override
053  default List<CI> getChoiceInstances() {
054    return getModelContainer().getChoiceInstances();
055  }
056
057  @Override
058  default CGI getChoiceGroupInstanceByName(String name) {
059    return getModelContainer().getChoiceGroupInstanceMap().get(name);
060  }
061
062  @Override
063  default Map<String, CGI> getChoiceGroupInstances() {
064    return getModelContainer().getChoiceGroupInstanceMap();
065  }
066}