{{!--
Add a multipart property to the body
@context a CodegenPropertyEncoding
@param propertyVar the variable name (or expression) containing the property
@param bodyPartsVar the variable name containing the list of body parts
@param content the CodegenContent
@param schemaUsage the schema usage for this value
--}}
{{#set '_nullable'}}
{{!-- We dont make array components into Optionals --}}
{{#and schemaUsage.nullable (not (isArray property))}}
true
{{/and}}
{{/set}}
{{{bodyPartsVar}}}.add(new org.apache.cxf.jaxrs.ext.multipart.AttachmentBuilder()
	.object({{#if _nullable}}!{{{propertyVar}}}.isPresent() ? null : {{{propertyVar}}}.get(){{else}}{{{propertyVar}}}{{/if}}{{#if valueProperty}}.{{getter valueProperty}}(){{#if valueProperty.nullable}}.orElse(null){{/if}}{{/if}})
	.mediaType({{{stringLiteral contentType}}})
	{{#ifeq content.mediaType.mimeType 'multipart/form-data'}}
	.contentDisposition(new org.apache.cxf.jaxrs.ext.multipart.ContentDisposition("form-data; name=\"{{{escapeString property.serializedName}}}\""))
	{{else}}
	.id({{{stringLiteral property.serializedName}}})
	{{/ifeq}}
	{{#each headerProperties}}
	.header({{{stringLiteral @key}}}, {{{../propertyVar}}}.{{getter .}}() != null ? {{{../propertyVar}}}.{{getter .}}().toString() : null)
	{{/each}}
	.build());
