1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.databind.codegen.impl;
7   
8   import com.squareup.javapoet.ClassName;
9   
10  import gov.nist.secauto.metaschema.core.util.ObjectUtils;
11  import gov.nist.secauto.metaschema.databind.codegen.IGeneratedClass;
12  
13  import java.nio.file.Path;
14  
15  import edu.umd.cs.findbugs.annotations.NonNull;
16  
17  /**
18   * Contains information about a generated class.
19   */
20  public class DefaultGeneratedClass implements IGeneratedClass {
21    @NonNull
22    private final Path classFile;
23    @NonNull
24    private final ClassName className;
25  
26    /**
27     * Construct a new class information object for a generated class.
28     *
29     * @param classFile
30     *          the file the class was written to
31     * @param className
32     *          the type info for the class
33     */
34    public DefaultGeneratedClass(@NonNull Path classFile, @NonNull ClassName className) {
35      this.classFile = ObjectUtils.requireNonNull(classFile, "classFile");
36      this.className = ObjectUtils.requireNonNull(className, "className");
37    }
38  
39    @Override
40    @NonNull
41    public Path getClassFile() {
42      return classFile;
43    }
44  
45    @Override
46    @NonNull
47    public ClassName getClassName() {
48      return className;
49    }
50  }