in thrifty-gradle-plugin/src/main/java/com/microsoft/thrifty/gradle/GenerateThriftSourcesWorkAction.java [198:241]
private void generateJavaThrifts(Schema schema, SerializableThriftOptions opts) {
ThriftyCodeGenerator gen = new ThriftyCodeGenerator(schema, policyFromNameStyle(opts.getNameStyle()));
gen.emitFileComment(true);
gen.emitParcelable(opts.isParcelable());
gen.failOnUnknownEnumValues(!opts.isAllowUnknownEnumValues());
if (opts.getListType() != null) {
gen.withListType(opts.getListType());
}
if (opts.getSetType() != null) {
gen.withSetType(opts.getSetType());
}
if (opts.getMapType() != null) {
gen.withMapType(opts.getMapType());
}
SerializableThriftOptions.Java jopt = opts.getJavaOpts();
NullabilityAnnotations anno = jopt.getNullabilityAnnotations();
if (anno == null) {
anno = NullabilityAnnotations.NONE;
}
switch (anno) {
case NONE:
gen.nullabilityAnnotationType(NullabilityAnnotationType.NONE);
break;
case ANDROID_SUPPORT:
gen.nullabilityAnnotationType(NullabilityAnnotationType.ANDROID_SUPPORT);
break;
case ANDROIDX:
gen.nullabilityAnnotationType(NullabilityAnnotationType.ANDROIDX);
break;
default:
throw new IllegalStateException("Unexpected NullabilityAnnotations value: " + anno);
}
gen.generate(getParameters().getOutputDirectory().getAsFile().get());
}