mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 10:15:53 +00:00
[fixes #3559[fixes #3497] Treat nested records as static
This commit is contained in:
1 parent
00893744eb
commit
fb09a99fae
14 files changed
+229
-6
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import lombok.With;
|
||||
public class WithOnNestedRecord<T> {
|
||||
public @With record Nested(String a, String b) {
|
||||
/* Implicit */ private final String a;
|
||||
/* Implicit */ private final String b;
|
||||
|
||||
/**
|
||||
* @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed).
|
||||
*/
|
||||
public @java.lang.SuppressWarnings("all") WithOnNestedRecord.Nested withA(final String a) {
|
||||
return ((this.a == a) ? this : new WithOnNestedRecord.Nested(a, this.b));
|
||||
}
|
||||
/**
|
||||
* @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed).
|
||||
*/
|
||||
public @java.lang.SuppressWarnings("all") WithOnNestedRecord.Nested withB(final String b) {
|
||||
return ((this.b == b) ? this : new WithOnNestedRecord.Nested(this.a, b));
|
||||
}
|
||||
}
|
||||
public WithOnNestedRecord() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user