/** * Constructor for when trying to encode from or decode to a specific Java type. * @since 5.1 */ public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType) { super(HttpStatus.UNSUPPORTED_MEDIA_TYPE, initReason(contentType, bodyType)); this.contentType = contentType; this.supportedMediaTypes = Collections.unmodifiableList(supportedTypes); this.bodyType = bodyType; }
/** * Constructor for when trying to encode from or decode to a specific Java type. * @since 5.1 */ public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType) { super(HttpStatus.UNSUPPORTED_MEDIA_TYPE, initReason(contentType, bodyType)); this.contentType = contentType; this.supportedMediaTypes = Collections.unmodifiableList(supportedTypes); this.bodyType = bodyType; }
/** * Constructor for when trying to encode from or decode to a specific Java type. * @since 5.1 */ public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType) { super(HttpStatus.UNSUPPORTED_MEDIA_TYPE, initReason(contentType, bodyType)); this.contentType = contentType; this.supportedMediaTypes = Collections.unmodifiableList(supportedTypes); this.bodyType = bodyType; }