@Test void testEncoderWithoutParam() { assertSame(fooBarEncoder, encoders.acceptedEncoder("text/plain, foo/bar")); }
public Encoder acceptedEncoder(CharSequence accept) { if (accept == null) { return defaultValue(); } String[] contentTypes = CONTENT_TYPE_DELIMITER.split(accept); for (String contentType : contentTypes) { String[] parts = PARAM_DELIMITER.split(contentType); Encoder encoder = get(parts[0]); if (encoder != null) { return encoder; } } return defaultValue(); }
Encoders extends MediaTypeCodecs<Encoder> { public Encoder acceptedEncoder(CharSequence accept) { if (accept == null) { return defaultValue(); } String[] contentTypes = CONTENT_TYPE_DELIMITER.split(accept); for (String contentType : contentTypes) { String[] parts = PARAM_DELIMITER.split(contentType); Encoder encoder = get(parts[0]); if (encoder != null) { return encoder; } } return defaultValue(); } }
Encoders extends MediaTypeCodecs<Encoder> { public Encoder acceptedEncoder(CharSequence accept) { if (accept == null) { return defaultValue(); } String[] contentTypes = CONTENT_TYPE_DELIMITER.split(accept); for (String contentType : contentTypes) { String[] parts = PARAM_DELIMITER.split(contentType); Encoder encoder = get(parts[0]); if (encoder != null) { return encoder; } } return defaultValue(); } @Builder private  Encoders(CharSequence defaultContentType, @Singular ImmutableList<Encoder> encoders); }
Encoders extends MediaTypeCodecs<Encoder> { public Encoder acceptedEncoder(CharSequence accept) { if (accept == null) { return defaultValue(); } String[] contentTypes = CONTENT_TYPE_DELIMITER.split(accept); for (String contentType : contentTypes) { String[] parts = PARAM_DELIMITER.split(contentType); Encoder encoder = get(parts[0]); if (encoder != null) { return encoder; } } return defaultValue(); } @Builder private  Encoders(CharSequence defaultContentType, @Singular ImmutableList<Encoder> encoders); Encoder acceptedEncoder(CharSequence accept); }
Encoders extends MediaTypeCodecs<Encoder> { public Encoder acceptedEncoder(CharSequence accept) { if (accept == null) { return defaultValue(); } String[] contentTypes = CONTENT_TYPE_DELIMITER.split(accept); for (String contentType : contentTypes) { String[] parts = PARAM_DELIMITER.split(contentType); Encoder encoder = get(parts[0]); if (encoder != null) { return encoder; } } return defaultValue(); } @Builder private  Encoders(CharSequence defaultContentType, @Singular ImmutableList<Encoder> encoders); Encoder acceptedEncoder(CharSequence accept);  }