Base32.Builder (Apache Commons Codec 1.22.1 API)
Description: declaration: package: org.apache.commons.codec.binary, class: Base32, class: Builder

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:
  `Supplier<Base32>`

Enclosing class:
  `Base32`

public static class Base32.Builder extends BaseNCodec.AbstractBuilder<Base32,Base32.Builder>
Builds `Base32` instances.

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

  Modifier and Type
  Method
  Description
  `Base32`
  `get()`
  `Base32.Builder`
  `setEncodeTable(byte... encodeTable)`
  Sets the encode table and derives the matching decode table.
  `Base32.Builder`
  `setHexDecodeTable(boolean useHex)`
  Sets the encode and decode tables to use Base32 hexadecimal if `true`, otherwise use the Base32 alphabet.
  `Base32.Builder`
  `setHexEncodeTable(boolean useHex)`
  Sets the encode table to use Base32 hexadecimal if `true`, otherwise use the Base32 alphabet.

  ### Methods inherited from class org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder

  `setDecodeTable, setDecodingPolicy, setLineLength, setLineSeparator, setPadding`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new instance using RFC 4648 Section 6, Table 3: The Base 32 Alphabet.

- ## Method Details

  - ### get

    public Base32 get()

  - ### setEncodeTable

    public Base32.Builder setEncodeTable(byte... encodeTable)
    Sets the encode table and derives the matching decode table.

    The RFC 4648 Base32 and Base32 Hex tables keep their case-insensitive decoders.

    Overrides:
      `setEncodeTable` in class `BaseNCodec.AbstractBuilder<Base32,Base32.Builder>`
    Parameters:
      `encodeTable` - The encode table with exactly 32 unique entries, null resets to the default.
    Returns:
      `this` instance.
    Throws:
      `IllegalArgumentException` - if the encode table does not contain exactly 32 unique entries.

  - ### setHexDecodeTable

    public Base32.Builder setHexDecodeTable(boolean useHex)
    Sets the encode and decode tables to use Base32 hexadecimal if `true`, otherwise use the Base32 alphabet.

    This overrides a value previously set with `setEncodeTable(byte...)`.

    Parameters:
      `useHex` - use Base32 hexadecimal if `true`, otherwise use the Base32 alphabet.
    Returns:
      `this` instance.
    Since:
      1.18.0

  - ### setHexEncodeTable

    public Base32.Builder setHexEncodeTable(boolean useHex)
    Sets the encode table to use Base32 hexadecimal if `true`, 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:
      `this` instance.
    Since:
      1.18.0