@Test public void testToString() throws Exception { assertEquals("text/xml", new ContentType("text/xml").toString()); assertEquals("image/svg+xml; charset=utf-8", new ContentType(" image/svg+xml; charset=utf-8").toString()); assertEquals("application/vnd.oasis.opendocument.text; charset=ISO-8859-1; version=1", new ContentType( " application/vnd.oasis.opendocument.text ; charset=ISO-8859-1 ; version=1 ").toString()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(typeSubtype); if (parameters != null) { for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("; ").append(entry.getKey()).append("=").append(entry.getValue()); } } return sb.toString(); }
ContentType { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(typeSubtype); if (parameters != null) { for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("; ").append(entry.getKey()).append("=").append(entry.getValue()); } } return sb.toString(); } }
ContentType { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(typeSubtype); if (parameters != null) { for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("; ").append(entry.getKey()).append("=").append(entry.getValue()); } } return sb.toString(); } ContentType(String str); }
ContentType { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(typeSubtype); if (parameters != null) { for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("; ").append(entry.getKey()).append("=").append(entry.getValue()); } } return sb.toString(); } ContentType(String str); String getTypeSubtype(); void setTypeSubtype(String typeSubtype); String getCharset(); @Override String toString(); }
ContentType { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(typeSubtype); if (parameters != null) { for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("; ").append(entry.getKey()).append("=").append(entry.getValue()); } } return sb.toString(); } ContentType(String str); String getTypeSubtype(); void setTypeSubtype(String typeSubtype); String getCharset(); @Override String toString();  }