Class DataURLs.Builder.WithMediaType
java.lang.Object
com.github.robtimus.net.protocol.data.DataURLs.Builder.WithMediaType
- Enclosing class:
- DataURLs.Builder
A class that can be used to build data URLs with media types.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateWithMediaType(DataURLs.Builder parent, MediaType mediaType) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a new data URL.withCharset(Charset charset) Sets the charset of the media type.withMediaTypeParameter(String name, String value) Sets the value for a media type parameter.
-
Field Details
-
parent
-
mimeType
-
parameters
-
-
Constructor Details
-
WithMediaType
-
-
Method Details
-
withMediaTypeParameter
Sets the value for a media type parameter.- Parameters:
name- The parameter name.value- The parameter value. Usenullto remove an existing parameter.- Returns:
- This builder object.
-
withCharset
Sets the charset of the media type. This method is shorthand forwithMediaTypeParameter("charset", charset.name()).- Parameters:
charset- The charset.- Returns:
- This builder object.
- Throws:
NullPointerException- If the charset isnull.
-
build
Creates a new data URL.- Returns:
- The created data URL.
-