Class FieldReadHook.Builder
- java.lang.Object
-
- com.tonic.analysis.instrumentation.hook.FieldReadHook.Builder
-
- Enclosing class:
- FieldReadHook
public static class FieldReadHook.Builder extends Object
Fluent builder forFieldReadHookinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldReadHookbuild()Builds the configured field read hook.FieldReadHook.Builderenabled(boolean enabled)Sets whether the hook is active.FieldReadHook.Builderfilters(List<InstrumentationFilter> filters)Sets the filters that restrict which code is instrumented.FieldReadHook.BuilderhookDescriptor(HookDescriptor hookDescriptor)Sets the hook method invoked at each instrumented field read.FieldReadHook.BuilderinstrumentInstance(boolean instrumentInstance)Sets whether instance field reads are instrumented.FieldReadHook.BuilderinstrumentStatic(boolean instrumentStatic)Sets whether static field reads are instrumented.FieldReadHook.BuilderpassFieldName(boolean passFieldName)Sets whether the field name is passed to the hook.FieldReadHook.BuilderpassOwner(boolean passOwner)Sets whether the field's owning object is passed to the hook.FieldReadHook.BuilderpassReadValue(boolean passReadValue)Sets whether the value that was read is passed to the hook.FieldReadHook.Builderpriority(int priority)Sets the ordering priority relative to other hooks.
-
-
-
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
-
filters
public FieldReadHook.Builder filters(List<InstrumentationFilter> filters)
Sets the filters that restrict which code is instrumented.- Parameters:
filters- the instrumentation filters- 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
-
-