@UseDataProvider("forTestToString") @Test public void testToString(MediaType mediaType, String expectedResult) { String header = mediaTypeHeaderDelegate.toString(mediaType); assertEquals(expectedResult, header); }
@Override public String toString(MediaType mime) { if (mime == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append(mime.getType()).append('/').append(mime.getSubtype()); for (Entry<String, String> entry : mime.getParameters().entrySet()) { sb.append(';').append(entry.getKey()).append('='); appendWithQuote(sb, entry.getValue()); } return sb.toString(); }
MediaTypeHeaderDelegate implements RuntimeDelegate.HeaderDelegate<MediaType> { @Override public String toString(MediaType mime) { if (mime == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append(mime.getType()).append('/').append(mime.getSubtype()); for (Entry<String, String> entry : mime.getParameters().entrySet()) { sb.append(';').append(entry.getKey()).append('='); appendWithQuote(sb, entry.getValue()); } return sb.toString(); } }
MediaTypeHeaderDelegate implements RuntimeDelegate.HeaderDelegate<MediaType> { @Override public String toString(MediaType mime) { if (mime == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append(mime.getType()).append('/').append(mime.getSubtype()); for (Entry<String, String> entry : mime.getParameters().entrySet()) { sb.append(';').append(entry.getKey()).append('='); appendWithQuote(sb, entry.getValue()); } return sb.toString(); }  }
MediaTypeHeaderDelegate implements RuntimeDelegate.HeaderDelegate<MediaType> { @Override public String toString(MediaType mime) { if (mime == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append(mime.getType()).append('/').append(mime.getSubtype()); for (Entry<String, String> entry : mime.getParameters().entrySet()) { sb.append(';').append(entry.getKey()).append('='); appendWithQuote(sb, entry.getValue()); } return sb.toString(); }  @Override MediaType fromString(String header); @Override String toString(MediaType mime); }
MediaTypeHeaderDelegate implements RuntimeDelegate.HeaderDelegate<MediaType> { @Override public String toString(MediaType mime) { if (mime == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append(mime.getType()).append('/').append(mime.getSubtype()); for (Entry<String, String> entry : mime.getParameters().entrySet()) { sb.append(';').append(entry.getKey()).append('='); appendWithQuote(sb, entry.getValue()); } return sb.toString(); }  @Override MediaType fromString(String header); @Override String toString(MediaType mime);  }