code: private MethodSpec buildTypedPatternMethod(String methodName, ClassName type, Format format) {
      MethodSpec.Builder method = MethodSpec.methodBuilder(methodName)
          .addAnnotation(Override.class)
          .addModifiers(PUBLIC)
          .addParameter(CALENDAR_FORMAT, "type")
          .addParameter(ZonedDateTime.class, "d")
          .addParameter(StringBuilder.class, "b");
  
      method.beginControlFlow("if (type == null)");
      method.addStatement("return");
      method.endControlFlow();
      
      method.beginControlFlow("switch (type)", type);
      addTypedPattern(method, "SHORT", format.short_);
      addTypedPattern(method, "MEDIUM", format.medium);
      addTypedPattern(method, "LONG", format.long_);
      addTypedPattern(method, "FULL", format.full);
      method.endControlFlow();
      
      return method.build();
    }
docs: The CLDR contains 4 standard pattern types for date and time: short, medium, long and full.
  This generates a switch statement to format patterns of this type.
  See CLDR "dateFormats" and "timeFormats" nodes.