Skip to content

Commit

Permalink
HollowAPIGenerator: preventing calls to build() prior to adequate spe…
Browse files Browse the repository at this point in the history
…cification of parameters
  • Loading branch information
dkoszewnik committed May 22, 2017
1 parent 2d9a131 commit 92714e7
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ public Builder withGetterPrefix(String getterPrefix) {
}

public HollowAPIGenerator 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()");

HollowAPIGenerator generator = new HollowAPIGenerator(apiClassname, packageName, dataset, parameterizedTypes, parameterizeAllClassnames);
generator.setClassPostfix(classPostfix);
generator.setGetterPrefix(getterPrefix);
Expand Down

0 comments on commit 92714e7

Please sign in to comment.