mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-19 14:16:07 +00:00
Added tests to @Data to check if a field starting with $ will be ignored
This commit is contained in:
1 parent
021c9a223c
commit
89c058f96e
2 files changed
+34
No files matched your search
@@ -0,0 +1,30 @@
|
||||
class DataIgnore {
|
||||
final int x;
|
||||
String $name;
|
||||
public DataIgnore(final int x) {
|
||||
this.x = x;
|
||||
}
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
if (o == this) return true;
|
||||
if (o == null) return false;
|
||||
if (o.getClass() != this.getClass()) return false;
|
||||
final DataIgnore other = (DataIgnore)o;
|
||||
if (this.x != other.x) return false;
|
||||
return true;
|
||||
}
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = result * PRIME + this.x;
|
||||
return result;
|
||||
}
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return "DataIgnore(x=" + x + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@lombok.Data class DataIgnore {
|
||||
final int x;
|
||||
String $name;
|
||||
}
|
||||
Reference in new issue
Block a user