@Test public void mediaTypesWithCompatibleCharsetsAreEqual() { final ImmutableMediaType one=defaultMediaType().build(); final ImmutableMediaType other=defaultMediaType().withCompatibleCharset().build(); assertThat(one.toString(),not(equalTo(other.toString()))); assertThat(one,equalTo(other)); }
@Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); @Override String type(); @Override String subType(); @Override Charset charset(); @Override String suffix(); @Override Map<String,String> parameters(); @Override boolean isWildcard(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString(); }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); @Override String type(); @Override String subType(); @Override Charset charset(); @Override String suffix(); @Override Map<String,String> parameters(); @Override boolean isWildcard(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString();  }