AbstractBaseNCodecStreamBuilder (Apache Commons Codec 1.22.1 API)
Description: declaration: package: org.apache.commons.codec.binary, class: AbstractBaseNCodecStreamBuilder

Package org.apache.commons.codec.binary

# Class AbstractBaseNCodecStreamBuilder<T,C extends BaseNCodec,B extends AbstractBaseNCodecStreamBuilder<T,C,B>>

java.lang.Object
org.apache.commons.codec.binary.AbstractBaseNCodecStreamBuilder<T,C,B>

Type Parameters:
  `T` - The stream type to build.
  `C` - A `BaseNCodec` subclass.
  `B` - The builder subclass.

All Implemented Interfaces:
  `Supplier<T>`

Direct Known Subclasses:
  `BaseNCodecInputStream.AbstracBuilder`, `BaseNCodecOutputStream.AbstractBuilder`

public abstract class AbstractBaseNCodecStreamBuilder<T,C extends BaseNCodec,B extends AbstractBaseNCodecStreamBuilder<T,C,B>> extends Object implements Supplier<T>
Builds input and output stream instances in `BaseNCodec` format.

Since:
  1.20.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractBaseNCodecStreamBuilder()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected C`
  `getBaseNCodec()`
  Gets the codec to encode/decode a stream.
  `protected boolean`
  `getEncode()`
  Gets whether to encode or decode a stream.
  `protected abstract C`
  `newBaseNCodec()`
  Creates a new BaseNCodec subclass of type C.
  `B`
  `setBaseNCodec(C baseNCodec)`
  Sets a BaseNCodec subclass of type C.
  `B`
  `setEncode(boolean encode)`
  Sets whether we should encode all data read (true), or if false if we should decode.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.function.Supplier

  `get`

- ## Constructor Details

  - ### AbstractBaseNCodecStreamBuilder

    public AbstractBaseNCodecStreamBuilder()
    Constructs a new instance.

- ## Method Details

  - ### getBaseNCodec

    protected C getBaseNCodec()
    Gets the codec to encode/decode a stream.
    Returns:
      The codec to encode/decode a stream.

  - ### getEncode

    protected boolean getEncode()
    Gets whether to encode or decode a stream.
    Returns:
      whether to encode or decode a stream.

  - ### newBaseNCodec

    protected abstract C newBaseNCodec()
    Creates a new BaseNCodec subclass of type C.
    Returns:
      A new BaseNCodec subclass of type C.

  - ### setBaseNCodec

    public B setBaseNCodec(C baseNCodec)
    Sets a BaseNCodec subclass of type C.
    Parameters:
      `baseNCodec` - A BaseNCodec subclass of type C.
    Returns:
      `this` instance.

  - ### setEncode

    public B setEncode(boolean encode)
    Sets whether we should encode all data read (true), or if false if we should decode.
    Parameters:
      `encode` - encode or decode.
    Returns:
      `this` instance.