Package org.apache.commons.codec.binary
Class Base16.Builder
- java.lang.Object
-
- org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder<Base16,Base16.Builder>
-
- org.apache.commons.codec.binary.Base16.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<Base16>
- Enclosing class:
- Base16
public static class Base16.Builder extends BaseNCodec.AbstractBuilder<Base16,Base16.Builder>
BuildsBase16instances.To configure a new instance, use a
Base16.Builder. For example:Base16 Base16 = Base16.builder() .setDecodingPolicy(DecodingPolicy.LENIENT) // default is lenient .get()
- Since:
- 1.20.0
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Base16get()Base16.BuildersetEncodeTable(byte... encodeTable)Sets the Base16 encode table and derives the matching decode table.Base16.BuildersetLowerCase(boolean lowerCase)Sets whether to use the lower-case Base16 alphabet.-
Methods inherited from class org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder
setDecodeTable, setDecodingPolicy, setLineLength, setLineSeparator, setPadding
-
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructs a new instance.
-
-
Method Detail
-
setEncodeTable
public Base16.Builder setEncodeTable(byte... encodeTable)
Sets the Base16 encode table and derives the matching decode table.- Overrides:
setEncodeTablein classBaseNCodec.AbstractBuilder<Base16,Base16.Builder>- Parameters:
encodeTable- 16 unique bytes, null resets to the default upper-case table.- Returns:
thisinstance.- Throws:
java.lang.IllegalArgumentException- Thrown ifencodeTabledoes not contain 16 unique bytes.
-
setLowerCase
public Base16.Builder setLowerCase(boolean lowerCase)
Sets whether to use the lower-case Base16 alphabet.- Parameters:
lowerCase-trueto use the lower-case Base16 alphabet.- Returns:
thisinstance.
-
-