Class MethodFingerprint


  • public class MethodFingerprint
    extends Object
    A method's identity fingerprint: three feature levels with precomputed hashes and an availability mask.
    • Constructor Detail

      • MethodFingerprint

        public MethodFingerprint​(String methodId,
                                 Level0Features l0,
                                 Level1Features l1,
                                 Level2Features l2)
        Creates a fingerprint and precomputes the hash of each valid level.
        Parameters:
        methodId - the identifier of the fingerprinted method
        l0 - the ultra-stable features, may be null
        l1 - the stable features, may be null
        l2 - the detailed features, may be null
    • Method Detail

      • getHash

        public byte[] getHash​(FingerprintLevel level)
        Parameters:
        level - the fingerprint level to read
        Returns:
        the precomputed hash for that level, or null if the level is unavailable
      • hasLevel

        public boolean hasLevel​(FingerprintLevel level)
        Parameters:
        level - the fingerprint level to test
        Returns:
        true if a hash was computed for that level
      • getMethodId

        public String getMethodId()
        Returns:
        the method id
      • getAvailableLevelsMask

        public int getAvailableLevelsMask()
        Returns:
        the available levels mask
      • getAvailableLevelsCount

        public int getAvailableLevelsCount()
        Returns:
        the number of levels with valid features