public static class GenerationConfig.Builder extends Object
This class is a Builder to build a RandomConfig
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 |
|---|---|
GenerationConfig |
build()
Build a new
RandomConfig with the parameters set. |
GenerationConfig.Builder |
setCodes(List<CodeConfig> codes)
Set the configurations of the barcodes generated.
|
GenerationConfig.Builder |
setEncoding(EncodingConfig encoding)
Set the encoding of the predefined values.
|
GenerationConfig.Builder |
setEncodings(List<EncodingConfig> encodings)
Set the configurations of the additional encodings generated.
|
GenerationConfig.Builder |
setSize(int size)
Set the size (in bits) of the random number generator.
|
public GenerationConfig.Builder setSize(int size)
Set the size (in bits) of the random number generator.
size - the size of the random number generator.public GenerationConfig.Builder setEncoding(EncodingConfig encoding)
Set the encoding of the predefined values.
encoding - the encoding.public GenerationConfig.Builder setCodes(List<CodeConfig> codes)
Set the configurations of the barcodes generated.
codes - the configuration of the barcodes.public GenerationConfig.Builder setEncodings(List<EncodingConfig> encodings)
Set the configurations of the additional encodings generated.
encodings - the configuration of the encodings.public GenerationConfig build()
Build a new RandomConfig with the parameters set.
RandomConfig.IllegalArgumentException - if size is either negative or not a multiple of 8, or code
and encodings is both null.Copyright © 2020 sw4j.org. All rights reserved.