-
public final class FormatHintsBundle of media type and file extension hints for the FormatHintsSniffer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classFormatHints.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Charsetcharsetprivate final List<MediaType>mediaTypesprivate final List<FileExtension>fileExtensions
-
Constructor Summary
Constructors Constructor Description FormatHints(List<MediaType> mediaTypes, List<FileExtension> fileExtensions)
-
Method Summary
Modifier and Type Method Description final CharsetgetCharset()final List<MediaType>getMediaTypes()final List<FileExtension>getFileExtensions()final FormatHintsplus(FormatHints other)final FormatHintsaddFileExtension(String fileExtension)Returns a new FormatHints after appending the given fileExtension hint. final BooleanhasFileExtension(String fileExtensions)Returns whether this context has any of the given file extensions, ignoring case. final BooleanhasMediaType(String mediaTypes)Returns whether this context has any of the given media type, ignoring case and extra parameters. -
-
Constructor Detail
-
FormatHints
FormatHints(List<MediaType> mediaTypes, List<FileExtension> fileExtensions)
-
-
Method Detail
-
getCharset
final Charset getCharset()
-
getMediaTypes
final List<MediaType> getMediaTypes()
-
getFileExtensions
final List<FileExtension> getFileExtensions()
-
plus
final FormatHints plus(FormatHints other)
-
addFileExtension
final FormatHints addFileExtension(String fileExtension)
Returns a new FormatHints after appending the given fileExtension hint.
-
hasFileExtension
final Boolean hasFileExtension(String fileExtensions)
Returns whether this context has any of the given file extensions, ignoring case.
-
hasMediaType
final Boolean hasMediaType(String mediaTypes)
Returns whether this context has any of the given media type, ignoring case and extra parameters.
Implementation note: Use MediaType to handle the comparison to avoid edge cases.
-
-
-
-