问题
Because we dont use tostring or equals and it reduces coverage.
So we need to disable lombok for tostring, equals
Is there any way?
For getter
@Getter(AccessLevel.NONE)
i can do this but for others, what can i do?
And as i understood,
@lombok.Accessors(chain = true, fluent = true)
this is also for getter setter
回答1:
I don't know what you're using for coverage, but we have enabled a lombok setting that prevents it from affecting our coverage. Create a lombok.config file at the top level of your project with this:
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
The first line is optional; it just tells lombok to stop searching for other config files. The second line causes lombok to add an annotation to the methods it creates marking them as being lombok generated. For the coverage tool we use, jacoco, that prevents it from taking these methods into consideration when calculating the coverage.
回答2:
If I understand your question correctly, this should do it.
@Setter
@Getter
public class SomeClass {
...
}
来源:https://stackoverflow.com/questions/52667771/lombok-use-only-getter-setter-not-equals-or-tostring