public B withParameterizeAllClassNames(boolean parameterizeAllClassNames) { this.parameterizeAllClassNames = parameterizeAllClassNames; return getBuilder(); }
public B withDestination(String destinationPath) { return withDestination(Paths.get(destinationPath)); }
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; } }
public B withDataModel(Class<?> ... classes) { HollowWriteStateEngine writeEngine = new HollowWriteStateEngine(); HollowObjectMapper mapper = new HollowObjectMapper(writeEngine); for(Class<?> clazz : classes) { mapper.initializeTypeState(clazz); } return withDataModel(writeEngine); }
public B withAPIClassname(String apiClassname) { this.apiClassname = apiClassname; return getBuilder(); }
public B withDataModel(HollowDataset dataset) { this.dataset = dataset; return getBuilder(); }
public B withPackageName(String packageName) { this.packageName = packageName; return getBuilder(); }
public B withParameterizedTypes(Set<String> parameterizedTypes) { this.parameterizedTypes = parameterizedTypes; return getBuilder(); }
public B withErgonomicShortcuts() { this.useErgonomicShortcuts = true; return getBuilder(); }
public B withDestination(Path destinationPath) { this.destinationPath = destinationPath; return getBuilder(); }
/** * NOTE: Have to be enabled with withErgonomicShortcuts * @return this builder */ public B withRestrictApiToFieldType() { config.setRestrictApiToFieldType(true); return getBuilder(); }
public B withClassPostfix(String classPostfix) { config.setClassPostfix(classPostfix); return getBuilder(); }
public B reservePrimaryKeyIndexForTypeWithPrimaryKey(boolean reservePrimaryKeyIndexForTypeWithPrimaryKey) { config.setReservePrimaryKeyIndexForTypeWithPrimaryKey(reservePrimaryKeyIndexForTypeWithPrimaryKey); return getBuilder(); }
public B withGetterPrefix(String getterPrefix) { config.setGetterPrefix(getterPrefix); return getBuilder(); }
public B withAggressiveSubstitutions(boolean useAggressiveSubstitutions) { config.setUseAggressiveSubstitutions(useAggressiveSubstitutions); return getBuilder(); }
public B withBooleanFieldErgonomics(boolean useBooleanFieldErgonomics) { config.setUseBooleanFieldErgonomics(useBooleanFieldErgonomics); return getBuilder(); }
public B withVerboseToString(boolean useVerboseToString) { config.setUseVerboseToString(useVerboseToString); return getBuilder(); }
public B withPackageGrouping() { config.setUsePackageGrouping(true); return getBuilder(); }
public B withHollowPrimitiveTypes(boolean useHollowPrimitiveTypes) { config.setUseHollowPrimitiveTypes(useHollowPrimitiveTypes); return getBuilder(); }