MimeType implements Comparable<MimeType>, Serializable { private MimeType(String type, String subtype, List<String> suffixes, List<MimeType> equivalents, Option<String> description, Option<String> flavor, Option<String> flavorDescription) { this.type = type; this.subtype = subtype; this.suffixes = suffixes; this.equivalents = equivalents; this.description = description; this.flavor = flavor; this.flavorDescription = flavorDescription; } private  MimeType(String type, String subtype, List<String> suffixes,
                  List<MimeType> equivalents,
                  Option<String> description,
                  Option<String> flavor, Option<String> flavorDescription); static MimeType mimeType(String type, String subtype, List<String> suffixes,
                                  List<MimeType> equivalents,
                                  Option<String> description,
                                  Option<String> flavor, Option<String> flavorDescription); static MimeType mimeType(String type, String subtype, String suffix); static MimeType mimeType(String type, String subtype); String getType(); String getSubtype(); Option<String> getSuffix(); String[] getSuffixes(); boolean supportsSuffix(String suffix); Option<String> getDescription(); Option<String> getFlavor(); Option<String> getFlavorDescription(); boolean hasFlavor(String flavor); String asString(); boolean eq(MimeType other); boolean eq(String type, String subtype); boolean isEquivalentTo(String type, String subtype); int compareTo(MimeType m); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object that); final Function<MimeType, Boolean> eq; }
@Test public void testMimeType() { assertEquals("video/mp4", mimeType("video", "mp4").toString()); assertEquals("video/mp4", MimeTypes.parseMimeType("video/mp4").toString()); }