# 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.
  `Base32.Builder`
  `setHexDecodeTable(boolean useHex)`
  Sets the decode table 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 BaseNCodec.AbstractBuilder

  `setDecodeTable, setDecodingPolicy, setLineLength, setLineSeparator, setPadding`

  ### Methods inherited from class 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)
    Description copied from class: `BaseNCodec.AbstractBuilder`
    Sets the encode table.
    Overrides:
      `setEncodeTable` in class `BaseNCodec.AbstractBuilder<Base32, Base32.Builder>`
    Parameters:
      `encodeTable` - the encode table, null resets to the default.
    Returns:
      `this` instance.

  - ### setHexDecodeTable

    public Base32.Builder setHexDecodeTable(boolean useHex)
    Sets the decode table 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