@HashCodeAndEqualsPlugin.Enhance public static class MemberSubstitution.WithoutSpecification.ForMatchedField extends MemberSubstitution.WithoutSpecification
MemberSubstitution.WithoutSpecification.ForMatchedByteCodeElement, MemberSubstitution.WithoutSpecification.ForMatchedField, MemberSubstitution.WithoutSpecification.ForMatchedMethod
methodGraphCompiler, replacementFactory, strict, typePoolResolver
Modifier | Constructor and Description |
---|---|
protected |
ForMatchedField(MethodGraph.Compiler methodGraphCompiler,
MemberSubstitution.TypePoolResolver typePoolResolver,
boolean strict,
MemberSubstitution.Replacement.Factory replacementFactory,
ElementMatcher<? super FieldDescription.InDefinedShape> matcher)
Creates a new member substitution for a matched field that requires a specification for how to perform a substitution.
|
protected |
ForMatchedField(MethodGraph.Compiler methodGraphCompiler,
MemberSubstitution.TypePoolResolver typePoolResolver,
boolean strict,
MemberSubstitution.Replacement.Factory replacementFactory,
ElementMatcher<? super FieldDescription.InDefinedShape> matcher,
boolean matchRead,
boolean matchWrite)
Creates a new member substitution for a matched field that requires a specification for how to perform a substitution.
|
Modifier and Type | Method and Description |
---|---|
MemberSubstitution.WithoutSpecification |
onRead()
When invoked, only read access of the previously matched field is substituted.
|
MemberSubstitution.WithoutSpecification |
onWrite()
When invoked, only write access of the previously matched field is substituted.
|
MemberSubstitution |
replaceWith(MemberSubstitution.Substitution.Factory substitutionFactory)
Replaces any interaction with the supplied substitution.
|
replaceWith, replaceWith, replaceWith, replaceWith, replaceWithField, replaceWithInstrumentedMethod, replaceWithMethod, replaceWithMethod, stub
protected ForMatchedField(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Replacement.Factory replacementFactory, ElementMatcher<? super FieldDescription.InDefinedShape> matcher)
methodGraphCompiler
- The method graph compiler to use.typePoolResolver
- The type pool resolver to use.strict
- true
if the method processing should be strict where an exception is raised if a member cannot be found.replacementFactory
- The replacement factory to use.matcher
- A matcher for any field that should be substituted.protected ForMatchedField(MethodGraph.Compiler methodGraphCompiler, MemberSubstitution.TypePoolResolver typePoolResolver, boolean strict, MemberSubstitution.Replacement.Factory replacementFactory, ElementMatcher<? super FieldDescription.InDefinedShape> matcher, boolean matchRead, boolean matchWrite)
methodGraphCompiler
- The method graph compiler to use.typePoolResolver
- The type pool resolver to use.strict
- true
if the method processing should be strict where an exception is raised if a member cannot be found.replacementFactory
- The replacement factory to use.matcher
- A matcher for any field that should be substituted.matchRead
- true
if read access to a field should be substituted.matchWrite
- true
if write access to a field should be substituted.public MemberSubstitution.WithoutSpecification onRead()
public MemberSubstitution.WithoutSpecification onWrite()
public MemberSubstitution replaceWith(MemberSubstitution.Substitution.Factory substitutionFactory)
replaceWith
in class MemberSubstitution.WithoutSpecification
substitutionFactory
- The substitution factory to use for creating the applied substitution.Copyright © 2014–2019. All rights reserved.