Interface ChecksumBuilder

All Known Implementing Classes:
Crc32ChecksumBuilder

public interface ChecksumBuilder
Checksum Builder - interface for checksum BUILDERs.
The PRODUCTs of these checksum builders are Checksum instances.
If not otherwise stated, concrete instances are NOT safe to be used concurrently by multiple threads.
Author:
Karl Eilebrecht
  • Method Summary

    Modifier and Type Method Description
    void addBytes​(byte[] bytes)
    Builder-method to add a byte array
    void addDouble​(java.lang.Double value)
    Builder-method to add an double value
    void addInteger​(java.lang.Integer value)
    Builder-method to add an integer value
    void addLong​(java.lang.Long value)
    Builder-method to add a long value
    void addString​(java.lang.String text)
    Builder-method to add a string
    Checksum getChecksum()
    Concrete BUILDERs return checksum for the given text.
    This is the result of the BUILDERs life.
    void reset()
    re-initializes the builder, the instance shall afterwards behave like a new one.
  • Method Details

    • addString

      void addString​(java.lang.String text)
      Builder-method to add a string
      Parameters:
      text - some string or null
    • addLong

      void addLong​(java.lang.Long value)
      Builder-method to add a long value
      Parameters:
      value - some numeric value or null
    • addInteger

      void addInteger​(java.lang.Integer value)
      Builder-method to add an integer value
      Parameters:
      value - some numeric value or null
    • addDouble

      void addDouble​(java.lang.Double value)
      Builder-method to add an double value
      Parameters:
      value - some numeric value or null
    • addBytes

      void addBytes​(byte[] bytes)
      Builder-method to add a byte array
      Parameters:
      bytes - some bytes or null
    • getChecksum

      Concrete BUILDERs return checksum for the given text.
      This is the result of the BUILDERs life.
      Returns:
      checksum value
    • reset

      void reset()
      re-initializes the builder, the instance shall afterwards behave like a new one.