Class FieldReadHook.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • hookDescriptor

        public FieldReadHook.Builder hookDescriptor​(HookDescriptor hookDescriptor)
        Sets the hook method invoked at each instrumented field read.
        Parameters:
        hookDescriptor - the hook method descriptor
        Returns:
        this builder
      • enabled

        public FieldReadHook.Builder enabled​(boolean enabled)
        Sets whether the hook is active.
        Parameters:
        enabled - true to enable the hook
        Returns:
        this builder
      • priority

        public FieldReadHook.Builder priority​(int priority)
        Sets the ordering priority relative to other hooks.
        Parameters:
        priority - the priority value
        Returns:
        this builder
      • passOwner

        public FieldReadHook.Builder passOwner​(boolean passOwner)
        Sets whether the field's owning object is passed to the hook.
        Parameters:
        passOwner - true to pass the owning object
        Returns:
        this builder
      • passFieldName

        public FieldReadHook.Builder passFieldName​(boolean passFieldName)
        Sets whether the field name is passed to the hook.
        Parameters:
        passFieldName - true to pass the field name
        Returns:
        this builder
      • passReadValue

        public FieldReadHook.Builder passReadValue​(boolean passReadValue)
        Sets whether the value that was read is passed to the hook.
        Parameters:
        passReadValue - true to pass the read value
        Returns:
        this builder
      • instrumentStatic

        public FieldReadHook.Builder instrumentStatic​(boolean instrumentStatic)
        Sets whether static field reads are instrumented.
        Parameters:
        instrumentStatic - true to instrument static reads
        Returns:
        this builder
      • instrumentInstance

        public FieldReadHook.Builder instrumentInstance​(boolean instrumentInstance)
        Sets whether instance field reads are instrumented.
        Parameters:
        instrumentInstance - true to instrument instance reads
        Returns:
        this builder
      • build

        public FieldReadHook build()
        Builds the configured field read hook.
        Returns:
        the new hook