/** * Builder pattern method to return this {@code BodyPart} after additional configuration. * * @param type media type to set for this {@code BodyPart}. * @return body-part instance. */ public BodyPart type(final MediaType type) { setMediaType(type); return this; }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final MediaType mediaType) { setMediaType(mediaType); }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param entity entity for this body part. * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final Object entity, final MediaType mediaType) { setEntity(entity); setMediaType(mediaType); }
/** * Sets the {@link MediaType} for this {@link MultiPart}. If never set, * the default {@link MediaType} MUST be {@code multipart/mixed}. * * @param mediaType the new {@link MediaType}. * @throws IllegalArgumentException if the {@code type} property is not set to {@code multipart}. */ @Override public void setMediaType(MediaType mediaType) { if (!"multipart".equals(mediaType.getType())) { throw new IllegalArgumentException(mediaType.toString()); } super.setMediaType(mediaType); }
final String contentType = bodyPart.getHeaders().getFirst("Content-Type"); if (contentType != null) { bodyPart.setMediaType(MediaType.valueOf(contentType));
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final MediaType mediaType) { setMediaType(mediaType); }
/** * Builder pattern method to return this {@code BodyPart} after additional configuration. * * @param type media type to set for this {@code BodyPart}. * @return body-part instance. */ public BodyPart type(final MediaType type) { setMediaType(type); return this; }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final MediaType mediaType) { setMediaType(mediaType); }
/** * Builder pattern method to return this {@code BodyPart} after additional configuration. * * @param type media type to set for this {@code BodyPart}. * @return body-part instance. */ public BodyPart type(final MediaType type) { setMediaType(type); return this; }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final MediaType mediaType) { setMediaType(mediaType); }
/** * Builder pattern method to return this {@code BodyPart} after additional configuration. * * @param type media type to set for this {@code BodyPart}. * @return body-part instance. */ public BodyPart type(final MediaType type) { setMediaType(type); return this; }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final MediaType mediaType) { setMediaType(mediaType); }
/** * Builder pattern method to return this {@code BodyPart} after additional configuration. * * @param type media type to set for this {@code BodyPart}. * @return body-part instance. */ public BodyPart type(final MediaType type) { setMediaType(type); return this; }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param entity entity for this body part. * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final Object entity, final MediaType mediaType) { setEntity(entity); setMediaType(mediaType); }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param entity entity for this body part. * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final Object entity, final MediaType mediaType) { setEntity(entity); setMediaType(mediaType); }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param entity entity for this body part. * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final Object entity, final MediaType mediaType) { setEntity(entity); setMediaType(mediaType); }
/** * Instantiates a new {@code BodyPart} with the specified characteristics. * * @param entity entity for this body part. * @param mediaType {@link MediaType} for this body part. */ public BodyPart(final Object entity, final MediaType mediaType) { setEntity(entity); setMediaType(mediaType); }
/** * Sets the {@link MediaType} for this {@link MultiPart}. If never set, * the default {@link MediaType} MUST be {@code multipart/mixed}. * * @param mediaType the new {@link MediaType}. * @throws IllegalArgumentException if the {@code type} property is not set to {@code multipart}. */ @Override public void setMediaType(MediaType mediaType) { if (!"multipart".equals(mediaType.getType())) { throw new IllegalArgumentException(mediaType.toString()); } super.setMediaType(mediaType); }
/** * Sets the {@link MediaType} for this {@link MultiPart}. If never set, * the default {@link MediaType} MUST be {@code multipart/mixed}. * * @param mediaType the new {@link MediaType}. * @throws IllegalArgumentException if the {@code type} property is not set to {@code multipart}. */ @Override public void setMediaType(MediaType mediaType) { if (!"multipart".equals(mediaType.getType())) { throw new IllegalArgumentException(mediaType.toString()); } super.setMediaType(mediaType); }
/** * Sets the {@link MediaType} for this {@link MultiPart}. If never set, * the default {@link MediaType} MUST be {@code multipart/mixed}. * * @param mediaType the new {@link MediaType}. * @throws IllegalArgumentException if the {@code type} property is not set to {@code multipart}. */ @Override public void setMediaType(MediaType mediaType) { if (!"multipart".equals(mediaType.getType())) { throw new IllegalArgumentException(mediaType.toString()); } super.setMediaType(mediaType); }