Package org.apache.commons.codec.binary
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:
java.util.function.Supplier<T>
- Direct Known Subclasses:
Base16.Builder,Base32.Builder,Base58.Builder,Base64.Builder
- Enclosing class:
- BaseNCodec
public abstract static class BaseNCodec.AbstractBuilder<T,B extends BaseNCodec.AbstractBuilder<T,B>> extends java.lang.Object implements java.util.function.Supplier<T>BuildsBase64instances.- Since:
- 1.17.0
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]decodeTableprivate CodecPolicydecodingPolicyprivate byte[]defaultEncodeTableprivate intencodedBlockSizeprivate byte[]encodeTableprivate intlineLengthprivate byte[]lineSeparatorprivate bytepaddingPadding byte.private intunencodedBlockSize
-
Constructor Summary
Constructors Constructor Description AbstractBuilder(byte[] defaultEncodeTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) BasThis()Returns this instance typed as the subclass typeB.(package private) byte[]getDecodeTable()(package private) CodecPolicygetDecodingPolicy()(package private) intgetEncodedBlockSize()(package private) byte[]getEncodeTable()(package private) intgetLineLength()(package private) byte[]getLineSeparator()(package private) bytegetPadding()(package private) intgetUnencodedBlockSize()BsetDecodeTable(byte[] decodeTable)Sets the decode table.(package private) BsetDecodeTableRaw(byte[] decodeTable)Sets the decode table.BsetDecodingPolicy(CodecPolicy decodingPolicy)Sets the decoding policy.(package private) BsetEncodedBlockSize(int encodedBlockSize)Sets the encoded block size, subclasses normally set this on construction.BsetEncodeTable(byte... encodeTable)Sets the encode table.(package private) BsetEncodeTableRaw(byte... encodeTable)Sets the encode table.BsetLineLength(int lineLength)Sets the line length.BsetLineSeparator(byte... lineSeparator)Sets the line separator.BsetPadding(byte padding)Sets the padding byte.(package private) BsetUnencodedBlockSize(int unencodedBlockSize)Sets the unencoded block size, subclasses normally set this on construction.
-
-
-
Field Detail
-
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.
-
-
Method Detail
-
asThis
B asThis()
Returns this instance typed as the subclass typeB.This is the same as the expression:
(B) this
- Returns:
thisinstance typed as the subclass typeB.
-
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:
thisinstance.- Since:
- 1.20.0
-
setDecodeTableRaw
B setDecodeTableRaw(byte[] decodeTable)
Sets the decode table.- Parameters:
decodeTable- the decode table, null resets to the default.- Returns:
thisinstance.
-
setDecodingPolicy
public B setDecodingPolicy(CodecPolicy decodingPolicy)
Sets the decoding policy.- Parameters:
decodingPolicy- the decoding policy, null resets to the default.- Returns:
thisinstance.
-
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:
thisinstance.
-
setEncodeTable
public B setEncodeTable(byte... encodeTable)
Sets the encode table.- Parameters:
encodeTable- the encode table, null resets to the default.- Returns:
thisinstance.
-
setEncodeTableRaw
B setEncodeTableRaw(byte... encodeTable)
Sets the encode table.- Parameters:
encodeTable- the encode table, null resets to the default.- Returns:
thisinstance.
-
setLineLength
public B setLineLength(int lineLength)
Sets the line length.- Parameters:
lineLength- the line length, less than 0 resets to the default.- Returns:
thisinstance.
-
setLineSeparator
public B setLineSeparator(byte... lineSeparator)
Sets the line separator.- Parameters:
lineSeparator- the line separator, null resets to the default.- Returns:
thisinstance.
-
setPadding
public B setPadding(byte padding)
Sets the padding byte.- Parameters:
padding- the padding byte.- Returns:
thisinstance.
-
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:
thisinstance.
-
-