Skip to content

Support for accessing fiels on fields/method calls #1149

@avshenuk

Description

@avshenuk

Currently, there is no way to do a chain of field accesses. Like it is possible with method calls e.g.

.withMethodCall(MethodCall.invoke(...).onMethodCall())

So for instance, if I want to do something like

.withField("someFieldName").onMethodCall()

or

.withField("someFieldName").onField()

There is an option to provide a FieldLocator.Factory but it only operates within the current class.

There is one way it can be done in my mind, it's by using FieldAccessor e.g. like

.withMethodCall(FieldAccessor.ofField("someFieldName"))

and hence it can be chained as any other MethodCall.
But the problem is that FieldAccessor is an Implementation, not MethodCall :)

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions