@Test public void parse() { assertEquals(ContentType.APPLICATION_OCTET_STREAM, ContentType.parse("application/octet-stream")); assertNull(ContentType.parse("a")); assertNull(ContentType.parse("a/b;c")); assertNull(ContentType.parse("a/b;c=")); assertNull(ContentType.parse("a/b;c= ")); }
public static ContentType parse(final String format) { try { return ContentType.create(format); } catch (IllegalArgumentException e) { return null; } }
ContentType { public static ContentType parse(final String format) { try { return ContentType.create(format); } catch (IllegalArgumentException e) { return null; } } }
ContentType { public static ContentType parse(final String format) { try { return ContentType.create(format); } catch (IllegalArgumentException e) { return null; } } private  ContentType(final String type, final String subtype, final Map<String, String> parameters); }
ContentType { public static ContentType parse(final String format) { try { return ContentType.create(format); } catch (IllegalArgumentException e) { return null; } } private  ContentType(final String type, final String subtype, final Map<String, String> parameters); static ContentType create(final ContentType contentType,
      final String parameterName, final String parameterValue); static ContentType create(final String format); static ContentType parse(final String format); String getType(); String getSubtype(); Map<String, String> getParameters(); String getParameter(final String name); @Override int hashCode(); @Override boolean equals(final Object obj); boolean isCompatible(final ContentType other); String toContentTypeString(); @Override String toString(); }
ContentType { public static ContentType parse(final String format) { try { return ContentType.create(format); } catch (IllegalArgumentException e) { return null; } } private  ContentType(final String type, final String subtype, final Map<String, String> parameters); static ContentType create(final ContentType contentType,
      final String parameterName, final String parameterValue); static ContentType create(final String format); static ContentType parse(final String format); String getType(); String getSubtype(); Map<String, String> getParameters(); String getParameter(final String name); @Override int hashCode(); @Override boolean equals(final Object obj); boolean isCompatible(final ContentType other); String toContentTypeString(); @Override String toString(); static final String PARAMETER_CHARSET; static final String PARAMETER_IEEE754_COMPATIBLE; static final String PARAMETER_ODATA_METADATA; static final String VALUE_ODATA_METADATA_NONE; static final String VALUE_ODATA_METADATA_MINIMAL; static final String VALUE_ODATA_METADATA_FULL; static final ContentType APPLICATION_JSON; static final ContentType JSON; static final ContentType JSON_NO_METADATA; static final ContentType JSON_FULL_METADATA; static final ContentType APPLICATION_XML; static final ContentType APPLICATION_ATOM_XML; static final ContentType APPLICATION_ATOM_XML_ENTRY; static final ContentType APPLICATION_ATOM_XML_ENTRY_UTF8; static final ContentType APPLICATION_ATOM_XML_FEED; static final ContentType APPLICATION_ATOM_XML_FEED_UTF8; static final ContentType APPLICATION_ATOM_SVC; static final ContentType APPLICATION_OCTET_STREAM; static final ContentType APPLICATION_XHTML_XML; static final ContentType TEXT_HTML; static final ContentType TEXT_XML; static final ContentType TEXT_PLAIN; static final ContentType APPLICATION_SVG_XML; static final ContentType APPLICATION_FORM_URLENCODED; static final ContentType APPLICATION_HTTP; static final ContentType MULTIPART_MIXED; static final ContentType MULTIPART_FORM_DATA; }