@Test public void buildContentTypeWithDefaultValues() { ContentType contentType = new ContentTypeBuilder() .buildContentType(); assertNull(contentType); }
public ContentType buildContentType() { ContentType parsedContentType = null; if (StringUtils.isNotBlank(contentType)) { try { parsedContentType = ContentType.parse(contentType); } catch (ParseException | UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.CONTENT_TYPE + "'. " + e.getMessage(), e); } if (!StringUtils.isEmpty(requestCharacterSet)) { try { parsedContentType = parsedContentType.withCharset(requestCharacterSet); } catch (UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.REQUEST_CHARACTER_SET + "'. " + e.getMessage(), e); } } } return parsedContentType; }
ContentTypeBuilder { public ContentType buildContentType() { ContentType parsedContentType = null; if (StringUtils.isNotBlank(contentType)) { try { parsedContentType = ContentType.parse(contentType); } catch (ParseException | UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.CONTENT_TYPE + "'. " + e.getMessage(), e); } if (!StringUtils.isEmpty(requestCharacterSet)) { try { parsedContentType = parsedContentType.withCharset(requestCharacterSet); } catch (UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.REQUEST_CHARACTER_SET + "'. " + e.getMessage(), e); } } } return parsedContentType; } }
ContentTypeBuilder { public ContentType buildContentType() { ContentType parsedContentType = null; if (StringUtils.isNotBlank(contentType)) { try { parsedContentType = ContentType.parse(contentType); } catch (ParseException | UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.CONTENT_TYPE + "'. " + e.getMessage(), e); } if (!StringUtils.isEmpty(requestCharacterSet)) { try { parsedContentType = parsedContentType.withCharset(requestCharacterSet); } catch (UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.REQUEST_CHARACTER_SET + "'. " + e.getMessage(), e); } } } return parsedContentType; }  }
ContentTypeBuilder { public ContentType buildContentType() { ContentType parsedContentType = null; if (StringUtils.isNotBlank(contentType)) { try { parsedContentType = ContentType.parse(contentType); } catch (ParseException | UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.CONTENT_TYPE + "'. " + e.getMessage(), e); } if (!StringUtils.isEmpty(requestCharacterSet)) { try { parsedContentType = parsedContentType.withCharset(requestCharacterSet); } catch (UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.REQUEST_CHARACTER_SET + "'. " + e.getMessage(), e); } } } return parsedContentType; }  ContentTypeBuilder setContentType(String contentType); ContentTypeBuilder setRequestCharacterSet(String requestCharacterSet); ContentType buildContentType(); }
ContentTypeBuilder { public ContentType buildContentType() { ContentType parsedContentType = null; if (StringUtils.isNotBlank(contentType)) { try { parsedContentType = ContentType.parse(contentType); } catch (ParseException | UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.CONTENT_TYPE + "'. " + e.getMessage(), e); } if (!StringUtils.isEmpty(requestCharacterSet)) { try { parsedContentType = parsedContentType.withCharset(requestCharacterSet); } catch (UnsupportedCharsetException e) { throw new IllegalArgumentException("Could not parse input '" + HttpClientInputs.REQUEST_CHARACTER_SET + "'. " + e.getMessage(), e); } } } return parsedContentType; }  ContentTypeBuilder setContentType(String contentType); ContentTypeBuilder setRequestCharacterSet(String requestCharacterSet); ContentType buildContentType();  }