Class BaseNCodec.AbstractBuilder<T,B extends BaseNCodec.AbstractBuilder<T,B>>

java.lang.Object
org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder<T,B>
Type Parameters:
T - The codec type to build.
B - The codec builder subtype.
All Implemented Interfaces:
Supplier<T>
Direct Known Subclasses:
Base16.Builder, Base32.Builder, Base45.Builder, Base58.Builder, Base64.Builder
Enclosing class:
BaseNCodec

public abstract static class BaseNCodec.AbstractBuilder<T,B extends BaseNCodec.AbstractBuilder<T,B>> extends Object implements Supplier<T>
Builds Base64 instances.
Since:
1.17.0
  • Field Details

    • unencodedBlockSize

      private int unencodedBlockSize
    • encodedBlockSize

      private int encodedBlockSize
    • decodingPolicy

      private CodecPolicy decodingPolicy
    • lineLength

      private int lineLength
    • lineSeparator

      private byte[] lineSeparator
    • defaultEncodeTable

      private final byte[] defaultEncodeTable
    • encodeTable

      private byte[] encodeTable
    • decodeTable

      private byte[] decodeTable
    • padding

      private byte padding
      Padding byte.
  • Constructor Details

    • AbstractBuilder

      AbstractBuilder(byte[] defaultEncodeTable)
  • Method Details

    • clone

      static byte[] clone(byte[] array, byte[] defaultArray)
      Clones the given array or returns a default array if the array is null.
      Parameters:
      array - The array to test and clone if not null.
      defaultArray - The default array to return if the array is null.
      Returns:
      A clone of the array or the default array if the array is null.
    • asThis

      B asThis()
      Returns this instance typed as the subclass type B.

      This is the same as the expression:

       (B) this
       
      Returns:
      this instance typed as the subclass type B.
    • getDecodeTable

      byte[] getDecodeTable()
    • getDecodingPolicy

      CodecPolicy getDecodingPolicy()
    • getEncodedBlockSize

      int getEncodedBlockSize()
    • getEncodeTable

      byte[] getEncodeTable()
    • getLineLength

      int getLineLength()
    • getLineSeparator

      byte[] getLineSeparator()
    • getPadding

      byte getPadding()
    • getUnencodedBlockSize

      int getUnencodedBlockSize()
    • setDecodeTable

      public B setDecodeTable(byte[] decodeTable)
      Sets the decode table.
      Parameters:
      decodeTable - The decode table.
      Returns:
      this instance.
      Since:
      1.20.0
    • setDecodeTableRaw

      B setDecodeTableRaw(byte[] decodeTable)
      Sets the decode table.
      Parameters:
      decodeTable - The decode table, null resets to the default.
      Returns:
      this instance.
    • setDecodingPolicy

      public B setDecodingPolicy(CodecPolicy decodingPolicy)
      Sets the decoding policy.
      Parameters:
      decodingPolicy - The decoding policy, null resets to the default.
      Returns:
      this instance.
    • setEncodedBlockSize

      B setEncodedBlockSize(int encodedBlockSize)
      Sets the encoded block size, subclasses normally set this on construction.
      Parameters:
      encodedBlockSize - The encoded block size, subclasses normally set this on construction.
      Returns:
      this instance.
    • setEncodeTable

      public B setEncodeTable(byte... encodeTable)
      Sets the encode table.
      Parameters:
      encodeTable - The encode table, null resets to the default.
      Returns:
      this instance.
    • setEncodeTableRaw

      B setEncodeTableRaw(byte... encodeTable)
      Sets the encode table.
      Parameters:
      encodeTable - The encode table, null resets to the default.
      Returns:
      this instance.
    • setLineLength

      public B setLineLength(int lineLength)
      Sets the line length.
      Parameters:
      lineLength - The line length, less than 0 resets to the default.
      Returns:
      this instance.
    • setLineSeparator

      public B setLineSeparator(byte... lineSeparator)
      Sets the line separator.
      Parameters:
      lineSeparator - The line separator, null resets to the default.
      Returns:
      this instance.
    • setPadding

      public B setPadding(byte padding)
      Sets the padding byte.
      Parameters:
      padding - The padding byte.
      Returns:
      this instance.
    • setUnencodedBlockSize

      B setUnencodedBlockSize(int unencodedBlockSize)
      Sets the unencoded block size, subclasses normally set this on construction.
      Parameters:
      unencodedBlockSize - The unencoded block size, subclasses normally set this on construction.
      Returns:
      this instance.