Class Base45.Builder
java.lang.Object
org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder<Base45, Base45.Builder>
org.apache.commons.codec.binary.Base45.Builder
- Enclosing class:
Base45
Builds
Base45 instances.
To configure a new instance, use a Base45.Builder. For example:
Base45 base45 = Base45.builder().get();
- Since:
- 1.23.0
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Constructs a new instance using the Base45 alphabet as defined by RFC 9285. -
Method Summary
Modifier and TypeMethodDescriptionget()setDecodingPolicy(CodecPolicy decodingPolicy) Sets the decoding policy.setEncodeTable(byte... encodeTable) Sets the encode table and derives the matching decode table, so the codec can always decode its own output.setLineLength(int lineLength) Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.setLineSeparator(byte... lineSeparator) Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.setPadding(byte padding) Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.Methods inherited from class BaseNCodec.AbstractBuilder
setDecodeTable
-
Constructor Details
-
Builder
public Builder()Constructs a new instance using the Base45 alphabet as defined by RFC 9285.
-
-
Method Details
-
get
-
setDecodingPolicy
Sets the decoding policy.CodecPolicy.STRICTis the only supported policy.- Overrides:
setDecodingPolicyin classBaseNCodec.AbstractBuilder<Base45, Base45.Builder>- Parameters:
decodingPolicy- The decoding policy;nullresets to the default (CodecPolicy.STRICT).- Returns:
thisinstance.- Throws:
IllegalArgumentException- Thrown if the given policy isCodecPolicy.LENIENT.
-
setEncodeTable
Sets the encode table and derives the matching decode table, so the codec can always decode its own output.- Overrides:
setEncodeTablein classBaseNCodec.AbstractBuilder<Base45, Base45.Builder>- Parameters:
encodeTable- The encode table with exactly 45 unique entries, null resets to the default.- Returns:
thisinstance.- Throws:
IllegalArgumentException- Thrown if the encode table does not contain exactly 45 unique entries.
-
setLineLength
Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.- Overrides:
setLineLengthin classBaseNCodec.AbstractBuilder<Base45, Base45.Builder>- Parameters:
lineLength- The line length, less than 0 resets to the default.- Returns:
thisinstance.- Throws:
UnsupportedOperationException- Thrown because Base45 RFC 9285 does not support this operation.
-
setLineSeparator
Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.- Overrides:
setLineSeparatorin classBaseNCodec.AbstractBuilder<Base45, Base45.Builder>- Parameters:
lineSeparator- The line separator, null resets to the default.- Returns:
thisinstance.- Throws:
UnsupportedOperationException- Thrown because Base45 RFC 9285 does not support this operation.
-
setPadding
Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.- Overrides:
setPaddingin classBaseNCodec.AbstractBuilder<Base45, Base45.Builder>- Parameters:
padding- The padding byte.- Returns:
thisinstance.- Throws:
UnsupportedOperationException- Thrown because Base45 RFC 9285 does not support this operation.
-