code: public String toType(ClassTemplateSpec spec, boolean isOptional) {
      String type = toTypeString(spec);
      return type + (isOptional ? "?" : "");
    }
docs: Returns the Swift type of an optional field for the given {@link ClassTemplateSpec} as a
  Swift source code string.
  
  Even if the field is required, it still will be represented as optional when
  Optionality is set to {@link SwiftProperties.Optionality#REQUIRED_FIELDS_MAY_BE_ABSENT}.
  
  @param spec to get a Swift type name for.
  @param isOptional indicates if the type is optional or not.
  @return Swift source code string identifying the given type.