Package org.apache.commons.codec.binary
Class Base45.Builder
- java.lang.Object
-
- org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder<Base45,Base45.Builder>
-
- org.apache.commons.codec.binary.Base45.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<Base45>
- Enclosing class:
- Base45
public static class Base45.Builder extends BaseNCodec.AbstractBuilder<Base45,Base45.Builder>
BuildsBase45instances.To configure a new instance, use a
Base45.Builder. For example:Base45 base45 = Base45.builder().get();
- Since:
- 1.23.0
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance using the Base45 alphabet as defined by RFC 9285.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Base45get()Base45.BuildersetDecodingPolicy(CodecPolicy decodingPolicy)Sets the decoding policy.Base45.BuildersetEncodeTable(byte... encodeTable)Sets the encode table and derives the matching decode table, so the codec can always decode its own output.Base45.BuildersetLineLength(int lineLength)Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.Base45.BuildersetLineSeparator(byte... lineSeparator)Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.Base45.BuildersetPadding(byte padding)Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.-
Methods inherited from class org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder
setDecodeTable
-
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructs a new instance using the Base45 alphabet as defined by RFC 9285.
-
-
Method Detail
-
setDecodingPolicy
public Base45.Builder setDecodingPolicy(CodecPolicy decodingPolicy)
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:
java.lang.IllegalArgumentException- Thrown if the given policy isCodecPolicy.LENIENT.
-
setEncodeTable
public Base45.Builder setEncodeTable(byte... encodeTable)
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:
java.lang.IllegalArgumentException- Thrown if the encode table does not contain exactly 45 unique entries.
-
setLineLength
public Base45.Builder setLineLength(int lineLength)
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:
java.lang.UnsupportedOperationException- Thrown because Base45 RFC 9285 does not support this operation.
-
setLineSeparator
public Base45.Builder setLineSeparator(byte... lineSeparator)
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:
java.lang.UnsupportedOperationException- Thrown because Base45 RFC 9285 does not support this operation.
-
setPadding
public Base45.Builder setPadding(byte padding)
Always throwsUnsupportedOperationException; unsupported by Base45 RFC 9285.- Overrides:
setPaddingin classBaseNCodec.AbstractBuilder<Base45,Base45.Builder>- Parameters:
padding- The padding byte.- Returns:
thisinstance.- Throws:
java.lang.UnsupportedOperationException- Thrown because Base45 RFC 9285 does not support this operation.
-
-