public static class CodeConfig.Builder extends Object
This class is a Builder to build a CodeConfig
programmatically. All methods to set the values are fluent to ease the building of a configuration.
This class is not thread save.
Constructor and Description |
---|
Builder()
Create a new
Builder . |
Modifier and Type | Method and Description |
---|---|
CodeConfig |
build()
Build a new
CodeConfig with the parameters set. |
CodeConfig.Builder |
setEncoding(EncodingConfig encoding)
Set the encoding of the random number in the barcode.
|
CodeConfig.Builder |
setErrorCorrection(String errorCorrection)
Set the error correction of the barcode.
|
CodeConfig.Builder |
setFiletype(String filetype)
Set the file type of the barcode.
|
CodeConfig.Builder |
setHeight(int height)
Set the height of the barcode.
|
CodeConfig.Builder |
setType(String type)
Set the type of the barcode.
|
CodeConfig.Builder |
setUrl(String url)
Set the URL (or text) of the barcode.
|
CodeConfig.Builder |
setWidth(int width)
Set the width of the barcode.
|
public CodeConfig.Builder setType(String type)
Set the type of the barcode.
type
- the type of the barcode.public CodeConfig.Builder setWidth(int width)
Set the width of the barcode.
width
- the width of the barcode.public CodeConfig.Builder setHeight(int height)
Set the height of the barcode.
height
- the height of the barcode.public CodeConfig.Builder setErrorCorrection(String errorCorrection)
Set the error correction of the barcode.
errorCorrection
- the error correction of the barcode.public CodeConfig.Builder setFiletype(String filetype)
Set the file type of the barcode.
filetype
- the file type of the barcode.public CodeConfig.Builder setEncoding(EncodingConfig encoding)
Set the encoding of the random number in the barcode.
encoding
- the encoding of the random number in the barcode.public CodeConfig.Builder setUrl(String url)
Set the URL (or text) of the barcode.
url
- the URL (or text) of the barcode.public CodeConfig build()
Build a new CodeConfig
with the parameters set.
CodeConfig
.IllegalArgumentException
- if either the type or encoding is null
or the type is unknown.Copyright © 2020 sw4j.org. All rights reserved.