Package org.apache.commons.codec.binary
Class Base32.Builder
- java.lang.Object
-
- org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder<Base32,Base32.Builder>
-
- org.apache.commons.codec.binary.Base32.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<Base32>
- Enclosing class:
- Base32
public static class Base32.Builder extends BaseNCodec.AbstractBuilder<Base32,Base32.Builder>
BuildsBase32instances.To configure a new instance, use a
Base32.Builder. For example:Base32 base32 = Base32.builder() .setDecodingPolicy(DecodingPolicy.LENIENT) // default is lenient .setLineLength(0) // default is none .setLineSeparator('\r', '\n') // default is CR LF .setPadding('=') // default is '=' .setEncodeTable(customEncodeTable) // default is RFC 4648 Section 6, Table 3: The Base 32 Alphabet .get()- Since:
- 1.17.0
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance using RFC 4648 Section 6, Table 3: The Base 32 Alphabet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Base32get()Base32.BuildersetEncodeTable(byte... encodeTable)Sets the encode table.Base32.BuildersetHexDecodeTable(boolean useHex)Sets the decode table to use Base32 hexadecimal iftrue, otherwise use the Base32 alphabet.Base32.BuildersetHexEncodeTable(boolean useHex)Sets the encode table to use Base32 hexadecimal iftrue, otherwise use the Base32 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 using RFC 4648 Section 6, Table 3: The Base 32 Alphabet.
-
-
Method Detail
-
setEncodeTable
public Base32.Builder setEncodeTable(byte... encodeTable)
Description copied from class:BaseNCodec.AbstractBuilderSets the encode table.- Overrides:
setEncodeTablein classBaseNCodec.AbstractBuilder<Base32,Base32.Builder>- Parameters:
encodeTable- the encode table, null resets to the default.- Returns:
thisinstance.
-
setHexDecodeTable
public Base32.Builder setHexDecodeTable(boolean useHex)
Sets the decode table to use Base32 hexadecimal iftrue, otherwise use the Base32 alphabet.This overrides a value previously set with
setEncodeTable(byte...).- Parameters:
useHex- use Base32 hexadecimal iftrue, otherwise use the Base32 alphabet.- Returns:
thisinstance.- Since:
- 1.18.0
-
setHexEncodeTable
public Base32.Builder setHexEncodeTable(boolean useHex)
Sets the encode table to use Base32 hexadecimal iftrue, otherwise use the Base32 alphabet.This overrides a value previously set with
setEncodeTable(byte...).- Parameters:
useHex-- If true, then use RFC 4648 Section 7, Table 4: Base 32 Encoding with Extended Hex Alphabet
- If false, then use RFC 4648 Section 6, Table 3: The Base 32 Alphabet
- Returns:
thisinstance.- Since:
- 1.18.0
-
-