Serializablepublic class DataUrlBuilder extends Object implements Serializable
DataUrl instances| Constructor | Description |
|---|---|
DataUrlBuilder() |
| Modifier and Type | Method | Description |
|---|---|---|
DataUrl |
build() |
Creates a new
DataUrl instance |
byte[] |
getData() |
Gets the payload of the data url
|
DataUrlEncoding |
getEncoding() |
Sets the encoding method
|
Map<String,String> |
getHeaders() |
Get the headers/parameters of the data url
|
String |
getMimeType() |
Gets the MIME-Type of the data urls content
|
DataUrlBuilder |
setCharset(String charset) |
Shorthand to set the charset header
|
DataUrlBuilder |
setData(byte[] data) |
Sets the payload of the data url
|
DataUrlBuilder |
setDataUrl(DataUrl template) |
Fills this
DataUrlBuilder with the contents of the given
DataUrl template |
DataUrlBuilder |
setEncoding(DataUrlEncoding encoding) |
Gets the encoding method
|
DataUrlBuilder |
setHeader(String name,
String value) |
Shorthand to set a header/parameter
|
DataUrlBuilder |
setHeaders(Map<String,String> headers) |
Set the headers/parameters of the data url
|
DataUrlBuilder |
setMimeType(String mimeType) |
Sets the MIME-Type of the data urls content
|
public DataUrl build() throws NullPointerException
DataUrl instanceDataUrl instanceNullPointerException - if data or encoding is nullpublic byte[] getData()
public DataUrlBuilder setData(byte[] data)
data - Payload of the data urlDataUrlBuilder instancepublic String getMimeType()
public DataUrlBuilder setMimeType(String mimeType)
mimeType - MIME-Type of the data urls contentDataUrlBuilder instancepublic DataUrlEncoding getEncoding()
public DataUrlBuilder setEncoding(DataUrlEncoding encoding)
encoding - Encoding methodDataUrlBuilder instancepublic Map<String,String> getHeaders()
public DataUrlBuilder setHeaders(Map<String,String> headers)
headers - Headers/parameters of the data urlDataUrlBuilder instancepublic DataUrlBuilder setHeader(String name, String value)
name - Name of the header/parametervalue - Value of the header/parameterDataUrlBuilder instancepublic DataUrlBuilder setCharset(String charset)
charset - Charset nameDataUrlBuilder instancepublic DataUrlBuilder setDataUrl(DataUrl template)
DataUrlBuilder with the contents of the given
DataUrl templatetemplate - DataUrl templateDataUrlBuilder instanceCopyright © 2018. All rights reserved.