code: @Override
    public GeneratedCode generate(ClassTemplateSpec templateSpec) {
  
      String code;
      AndroidProperties androidProperties = AndroidProperties.lookupAndroidProperties(templateSpec);
      JavaSyntax syntax = new JavaSyntax(androidProperties);
  
      if (templateSpec instanceof RecordTemplateSpec) {
        code = engine.render("rythm-android/record.txt", templateSpec, syntax);
      } else if (templateSpec instanceof EnumTemplateSpec) {
        code = engine.render("rythm-android/enum.txt", templateSpec, syntax);
      } else if (templateSpec instanceof UnionTemplateSpec) {
        UnionTemplateSpec unionSpec = (UnionTemplateSpec) templateSpec;
        if (TypedDefinitions.isTypedDefinition(unionSpec)) {
          code = engine.render(
              "rythm-android/typedDefinition.txt",
              templateSpec,
              TypedDefinitions.getTypedDefinitionMapping(unionSpec, false),
              syntax);
        } else if (TypedDefinitions.isFlatTypedDefinition(unionSpec)) {
          code = engine.render(
              "rythm-android/flatTypedDefinition.txt",
              templateSpec,
              TypedDefinitions.getTypedDefinitionMapping(unionSpec, true),
              syntax);
        } else {
          code = engine.render("rythm-android/union.txt", templateSpec, syntax);
        }
      } else {
        return null; // Indicates that we are declining to generate code for the type (e.g. map or array)
      }
      JavaCompilationUnit compilationUnit =
          new JavaCompilationUnit(
              JavaSyntax.escapeKeyword(templateSpec.getClassName()), templateSpec.getNamespace());
      code = formatter.format(code);
  
      return new GeneratedCode(compilationUnit, code);
    }
docs: See {@link org.coursera.courier.android.AndroidProperties} for customization options.