Interface ContentType
- All Superinterfaces:
ContentType,Renderable,ToStringRenderable,ValueRenderable
- All Known Subinterfaces:
ContentType.NonBinary
- All Known Implementing Classes:
ContentType.Binary,ContentType.WithCharset,ContentType.WithFixedCharset,ContentType.WithMissingCharset
A
ContentType represents a specific MediaType / HttpCharset combination.
If the MediaType is not flexible with regard to the charset used, e.g. because it's a binary MediaType or
the charset is fixed, then the ContentType is a simple wrapper.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic final classRepresents a content-type which we know not to contain text (will never have have a charset)static classstatic interfaceRepresents a content-type which we know to contain text, and has a specified charset.static final classRepresents a content-type which we know to contain text, and the charset is known at runtime.static classstatic final classRepresents a content-type which we know to contain text, where the charset always has the same predefined value.static classstatic final classRepresents a content-type which we know to contain text, and would be better off having a charset, but the client or server hasn't provided that.static class -
Method Summary
Modifier and TypeMethodDescriptionscala.Option<HttpCharset>Java APIThe media-type of this content-type.render(R r) toString()Methods inherited from interface org.apache.pekko.http.javadsl.model.ContentType
binary, valueMethods inherited from interface org.apache.pekko.http.impl.util.ValueRenderable
value
-
Method Details
-
mediaType
MediaType mediaType()Description copied from interface:ContentTypeThe media-type of this content-type.- Specified by:
mediaTypein interfaceContentType- Returns:
- (undocumented)
-
charsetOption
scala.Option<HttpCharset> charsetOption() -
toString
String toString()- Specified by:
toStringin interfaceToStringRenderable- Overrides:
toStringin classObject
-
render
- Specified by:
renderin interfaceRenderable
-
getCharsetOption
Optional<HttpCharset> getCharsetOption()Java API- Specified by:
getCharsetOptionin interfaceContentType- Returns:
- (undocumented)
-