001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.databind.codegen.config;
007
008import java.util.LinkedList;
009import java.util.List;
010
011import edu.umd.cs.findbugs.annotations.NonNull;
012import edu.umd.cs.findbugs.annotations.Nullable;
013
014public class DefaultDefinitionBindingConfiguration implements IMutableDefinitionBindingConfiguration {
015  @Nullable
016  private String className;
017  @Nullable
018  private String baseClassName;
019  @NonNull
020  private final List<String> interfacesToImplement = new LinkedList<>();
021
022  /**
023   * Create a new definition binding configuration.
024   */
025  public DefaultDefinitionBindingConfiguration() {
026    // empty configuration
027  }
028
029  /**
030   * Create a new definition binding configuration based on a previous
031   * configuration.
032   *
033   * @param config
034   *          the previous configuration
035   */
036  public DefaultDefinitionBindingConfiguration(@NonNull IDefinitionBindingConfiguration config) {
037    this.className = config.getClassName();
038    this.baseClassName = config.getQualifiedBaseClassName();
039    this.interfacesToImplement.addAll(config.getInterfacesToImplement());
040  }
041
042  @Override
043  public String getClassName() {
044    return className;
045  }
046
047  @Override
048  public void setClassName(String name) {
049    this.className = name;
050  }
051
052  @Override
053  public String getQualifiedBaseClassName() {
054    return baseClassName;
055  }
056
057  @Override
058  public void setQualifiedBaseClassName(String name) {
059    this.baseClassName = name;
060  }
061
062  @Override
063  public List<String> getInterfacesToImplement() {
064    return interfacesToImplement;
065  }
066
067  @Override
068  public void addInterfaceToImplement(String interfaceName) {
069    this.interfacesToImplement.add(interfaceName);
070  }
071}