Package akka.http.javadsl.model
Interface ContentType
-
- All Known Subinterfaces:
ContentType,ContentType.Binary,ContentType.NonBinary,ContentType.NonBinary,ContentType.WithCharset,ContentType.WithFixedCharset,ContentType.WithMissingCharset
- All Known Implementing Classes:
ContentType.Binary,ContentType.WithCharset,ContentType.WithFixedCharset,ContentType.WithMissingCharset
public interface ContentTypeRepresents an Http content-type. A content-type consists of a media-type and an optional charset.See
ContentTypesfor convenience access to often used values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceContentType.BinaryRepresents a content-type which we know not to contain text (will never have a charset)static interfaceContentType.NonBinaryRepresents a content-type which we know to contain text, and has a specified charset.static interfaceContentType.WithCharsetRepresents a content-type which we know to contain text, and the charset is known at runtime.static interfaceContentType.WithFixedCharsetRepresents a content-type which we know to contain text, where the charset always has the same predefined value.static interfaceContentType.WithMissingCharsetRepresents a content-type which we know to contain text, and would be better off having a charset, but the client hasn't provided that.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanbinary()True if this ContentType is non-textual.java.util.Optional<HttpCharset>getCharsetOption()Returns the charset if this ContentType is non-binary.MediaTypemediaType()The media-type of this content-type.
-
-
-
Method Detail
-
mediaType
MediaType mediaType()
The media-type of this content-type.- Returns:
- (undocumented)
-
binary
boolean binary()
True if this ContentType is non-textual.- Returns:
- (undocumented)
-
getCharsetOption
java.util.Optional<HttpCharset> getCharsetOption()
Returns the charset if this ContentType is non-binary.- Returns:
- (undocumented)
-
-