public G build() { if (apiClassname == null) throw new IllegalStateException("Please specify an API classname (.withAPIClassname()) before calling .build()"); if (packageName == null) throw new IllegalStateException("Please specify a package name (.withPackageName()) before calling .build()"); if (dataset == null) throw new IllegalStateException("Please specify a data model (.withDataModel()) before calling .build()"); if(config.isRestrictApiToFieldType() && !useErgonomicShortcuts) { throw new IllegalStateException(" restrictApiToFieldType requires withErgonomicShortcuts"); } G generator = instantiateGenerator(); generator.setCodeGeneratorConfig(config); return generator; } }