Class ERSCachingData

    • Constructor Summary

      Constructors 
      Constructor Description
      ERSCachingData()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract byte[] calculateHash​(DigestCalculator digestCalculator, byte[] previousChainHash)
      Compute the hash for this data object.
      byte[] getHash​(DigestCalculator digestCalculator, byte[] previousChainHash)
      Return the hash for this data object, computing it (via the subclass) on first request and returning the cached value thereafter.
      • Methods inherited from class java.lang.Object

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

      • ERSCachingData

        public ERSCachingData()
    • Method Detail

      • getHash

        public byte[] getHash​(DigestCalculator digestCalculator,
                              byte[] previousChainHash)
        Return the hash for this data object, computing it (via the subclass) on first request and returning the cached value thereafter.
        Specified by:
        getHash in interface ERSData
        Parameters:
        digestCalculator - the DigestCalculator to use for computing the hash.
        previousChainHash - hash from an earlier chain to fold in, or null.
        Returns:
        the calculated hash for this data object.
      • calculateHash

        protected abstract byte[] calculateHash​(DigestCalculator digestCalculator,
                                                byte[] previousChainHash)
        Compute the hash for this data object. Implemented by subclasses; the result is cached by getHash(DigestCalculator, byte[]).
        Parameters:
        digestCalculator - the digest calculator to use.
        previousChainHash - hash from an earlier chain to fold in, or null.
        Returns:
        the calculated hash.