[annotation based ToString] hey.. we have annotation based ToString now, where you can include/exclude fields by annotating the fields.

This commit is contained in:
Reinier Zwitserloot committed 2018-05-14 22:03:46 +02:00
1 parent 82a7354a84
commit ad21a1573b
24 files changed
+639 -192

No files matched your search

@@ -0,0 +1,20 @@
import lombok.ToString;
public @ToString class ToStringNewStyle {
@ToString.Include(name = "a") int b;
double c;
int f;
@ToString.Include(name = "e") int d;
int g;
@ToString.Include(rank = (- 1)) int h;
int i;
@ToString.Exclude int j;
public ToStringNewStyle() {
super();
}
@ToString.Include int f() {
return 0;
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((((((((((((("ToStringNewStyle(a=" + this.b) + ", c=") + this.c) + ", e=") + this.d) + ", f=") + this.f()) + ", g=") + this.g) + ", i=") + this.i) + ", h=") + this.h) + ")");
}
}