Crc16.Builder (Apache Commons Codec 1.22.0 API)
Description: declaration: package: org.apache.commons.codec.digest, class: Crc16, class: Builder

Package org.apache.commons.codec.digest

# Class Crc16.Builder

java.lang.Object
org.apache.commons.codec.digest.Crc16.Builder

All Implemented Interfaces:
  `Supplier<Crc16>`

Enclosing class:
  `Crc16`

public static final class Crc16.Builder extends Object implements Supplier<Crc16>
Builds `Crc16` instances.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Crc16`
  `get()`
  Creates a new `Crc16` instance.
  `Crc16.Builder`
  `setInit(int init)`
  Sets the initial value.
  `Crc16.Builder`
  `setTable(int[] table)`
  Sets the lookup table.
  `Crc16.Builder`
  `setXorOut(int xorOut)`
  Sets the XorOut value to XOR to the current checksum returned by `Crc16.getValue()`.

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

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

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new instance.

- ## Method Details

  - ### get

    public Crc16 get()
    Creates a new `Crc16` instance.
    Specified by:
      `get` in interface `Supplier<Crc16>`

  - ### setInit

    public Crc16.Builder setInit(int init)
    Sets the initial value.
    Parameters:
      `init` - the initial value.
    Returns:
      `this` instance.

  - ### setTable

    public Crc16.Builder setTable(int[] table)
    Sets the lookup table.
    Parameters:
      `table` - the lookup table, making a clone of the input array, must not be null.
    Returns:
      `this` instance.

  - ### setXorOut

    public Crc16.Builder setXorOut(int xorOut)
    Sets the XorOut value to XOR to the current checksum returned by `Crc16.getValue()`.
    Parameters:
      `xorOut` - the XorOut value.
    Returns:
      `this` instance.