Class ChecksumHelper


  • public class ChecksumHelper
    extends java.lang.Object
    Checksum Helper - the DIRECTOR in this BUILDER example.
    Instances of this class create a checksum out of a given object array using a BUILDER.
    These helper instances are not safe to be used concurrently by multiple threads.
    Author:
    Karl Eilebrecht
    • Constructor Summary

      Constructors 
      Constructor Description
      ChecksumHelper​(ChecksumBuilder checksumBuilder)
      Creates new helper instance using the given builder (kind of CONSTRUCTOR INJECTION).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long computeChecksum​(java.lang.Object[] data)
      This method of the director uses the builder INTERNALLY to compute a checksum over the given array elements.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChecksumHelper

        public ChecksumHelper​(ChecksumBuilder checksumBuilder)
        Creates new helper instance using the given builder (kind of CONSTRUCTOR INJECTION).
        Parameters:
        checksumBuilder - instance to be used internally
    • Method Detail

      • computeChecksum

        public long computeChecksum​(java.lang.Object[] data)
        This method of the director uses the builder INTERNALLY to compute a checksum over the given array elements.
        Parameters:
        data - array elements
        Returns:
        checksum