import static java.util.Objects.requireNonNull;
import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
import java.io.File;
/**
* Generates files with JAVA source codes for every specified type.
- *
*/
public final class GeneratorJavaFile {
public enum FileKind {
private final Collection<? extends Type> types;
/**
- * Creates instance of this class with the set of <code>types</code> for
- * which the JAVA code is generated. Generator instantiated this way uses
- * the default build context, e.g. it will re-generate any and all files.
- *
- * The instances of concrete JAVA code generator are created.
+ * Creates instance of this class with the set of <code>types</code> for which the JAVA code is generated. Generator
+ * instantiated this way uses the default build context, e.g. it will re-generate any and all files. The instances
+ * of concrete JAVA code generator are created.
*
- * @param types
- * set of types for which JAVA code should be generated
+ * @param types set of types for which JAVA code should be generated
*/
public GeneratorJavaFile(final Collection<? extends Type> types) {
- this.types = Preconditions.checkNotNull(types);
+ this.types = requireNonNull(types);
generators.add(new InterfaceGenerator());
generators.add(new TOGenerator());
generators.add(new EnumGenerator());
}
/**
- * Creates the package directory path as concatenation of
- * <code>parentDirectory</code> and parsed <code>packageName</code>. The
- * parsing of <code>packageName</code> is realized as replacement of the
- * package name dots with the file system separator.
+ * Creates the package directory path as concatenation of <code>parentDirectory</code> and parsed
+ * <code>packageName</code>. The parsing of <code>packageName</code> is realized as replacement of the package name
+ * dots with the file system separator.
*
- * @param parentDirectory
- * <code>File</code> object with reference to parent directory
- * @param packageName
- * string with the name of the package
- * @return <code>File</code> object which refers to the new directory for
- * package <code>packageName</code>
+ * @param parentDirectory <code>File</code> object with reference to parent directory
+ * @param packageName string with the name of the package
+ * @return <code>File</code> object which refers to the new directory for package <code>packageName</code>
*/
public static File packageToDirectory(final File parentDirectory, final String packageName) {
if (packageName == null) {