Class SearchResult


  • public class SearchResult
    extends Object
    A single pattern-search hit, locating a class, method, or IR instruction with a description.
    • Constructor Detail

      • SearchResult

        public SearchResult​(ClassFile classFile,
                            MethodEntry method,
                            IRInstruction instruction,
                            int bytecodeOffset,
                            String description)
        Creates an instruction-level result.
        Parameters:
        classFile - the class the result refers to
        method - the matched method, may be null
        instruction - the matched IR instruction, may be null
        bytecodeOffset - the bytecode offset, or -1 if unknown
        description - what was matched
      • SearchResult

        public SearchResult​(ClassFile classFile,
                            MethodEntry method,
                            String description)
        Creates a method-level result with no instruction.
        Parameters:
        classFile - the class the result refers to
        method - the matched method
        description - what was matched
      • SearchResult

        public SearchResult​(ClassFile classFile,
                            String description)
        Creates a class-level result with no method or instruction.
        Parameters:
        classFile - the class the result refers to
        description - what was matched
    • Method Detail

      • getClassFile

        public ClassFile getClassFile()
        Returns:
        the class file
      • getMethod

        public MethodEntry getMethod()
        Returns:
        the method
      • getInstruction

        public IRInstruction getInstruction()
        Returns:
        the instruction
      • getBytecodeOffset

        public int getBytecodeOffset()
        Returns:
        the bytecode offset
      • getDescription

        public String getDescription()
        Returns:
        the description
      • getClassName

        public String getClassName()
        Returns:
        the class name, or null if no class is attached
      • getMethodName

        public String getMethodName()
        Returns:
        the method name, or null if no method is attached
      • getMethodDescriptor

        public String getMethodDescriptor()
        Returns:
        the method descriptor, or null if no method is attached
      • getLocation

        public String getLocation()
        Formats the result location as class, optional method signature, and optional bytecode offset.
        Returns:
        the human-readable location string
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object