1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package dev.metaschema.databind.codegen.config;
7   
8   import edu.umd.cs.findbugs.annotations.NonNull;
9   import edu.umd.cs.findbugs.annotations.Nullable;
10  
11  /**
12   * Provides binding configuration for a choice group within an assembly
13   * definition.
14   *
15   * <p>
16   * Choice group bindings enable fine-grained control over code generation for
17   * choice groups, particularly for specifying custom collection types with
18   * type-safe item bounds.
19   */
20  public interface IChoiceGroupBindingConfiguration {
21  
22    /**
23     * Get the name of the choice group to match.
24     *
25     * <p>
26     * This name corresponds to the {@code group-as} name specified in the
27     * Metaschema module for the choice group.
28     *
29     * @return the choice group name
30     */
31    @NonNull
32    String getGroupAsName();
33  
34    /**
35     * Get the fully qualified Java type name to use for collection items.
36     *
37     * <p>
38     * When specified, the generated field and getter will use this type instead of
39     * {@link Object} for the collection item type. This allows for type-safe
40     * collections when all choice alternatives share a common supertype.
41     *
42     * @return the fully qualified Java type name, or {@code null} if not specified
43     */
44    @Nullable
45    String getItemTypeName();
46  
47    /**
48     * Determine whether to use a wildcard bounded type for the collection.
49     *
50     * <p>
51     * When {@code true}, generates {@code List<? extends Type>} instead of
52     * {@code List<Type>}. This provides additional flexibility when the exact item
53     * type may vary while still maintaining type safety.
54     *
55     * <p>
56     * Defaults to {@code true} if an item type is specified.
57     *
58     * @return {@code true} to use wildcard bounds, {@code false} otherwise
59     */
60    boolean isUseWildcard();
61  }