mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 00:17:45 +00:00
gave the tests for issue #1397 (generated constructors take @Builder.Default into account) an update.
This commit is contained in:
1 parent
7472672f16
commit
b3771e86f9
6 files changed
+178
-52
No files matched your search
@@ -2,10 +2,11 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Value;
|
||||
import lombok.Builder;
|
||||
final @NoArgsConstructor @AllArgsConstructor @Builder @Value class ConstructorsWithBuilderDefaults {
|
||||
final @NoArgsConstructor(force = true) @AllArgsConstructor @Builder @Value class ConstructorsWithBuilderDefaults {
|
||||
public static @java.lang.SuppressWarnings("all") class ConstructorsWithBuilderDefaultsBuilder {
|
||||
private @java.lang.SuppressWarnings("all") int x;
|
||||
private @java.lang.SuppressWarnings("all") boolean x$set;
|
||||
private @java.lang.SuppressWarnings("all") int y;
|
||||
@java.lang.SuppressWarnings("all") ConstructorsWithBuilderDefaultsBuilder() {
|
||||
super();
|
||||
}
|
||||
@@ -14,14 +15,19 @@ final @NoArgsConstructor @AllArgsConstructor @Builder @Value class ConstructorsW
|
||||
x$set = true;
|
||||
return this;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") ConstructorsWithBuilderDefaultsBuilder y(final int y) {
|
||||
this.y = y;
|
||||
return this;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") ConstructorsWithBuilderDefaults build() {
|
||||
return new ConstructorsWithBuilderDefaults((x$set ? x : ConstructorsWithBuilderDefaults.$default$x()));
|
||||
return new ConstructorsWithBuilderDefaults((x$set ? x : ConstructorsWithBuilderDefaults.$default$x()), y);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("ConstructorsWithBuilderDefaults.ConstructorsWithBuilderDefaultsBuilder(x=" + this.x) + ")");
|
||||
return (((("ConstructorsWithBuilderDefaults.ConstructorsWithBuilderDefaultsBuilder(x=" + this.x) + ", y=") + this.y) + ")");
|
||||
}
|
||||
}
|
||||
private final @Builder.Default int x;
|
||||
private final int y;
|
||||
private static @java.lang.SuppressWarnings("all") int $default$x() {
|
||||
return 5;
|
||||
}
|
||||
@@ -31,6 +37,9 @@ final @NoArgsConstructor @AllArgsConstructor @Builder @Value class ConstructorsW
|
||||
public @java.lang.SuppressWarnings("all") int getX() {
|
||||
return this.x;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getY() {
|
||||
return this.y;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
@@ -39,23 +48,28 @@ final @NoArgsConstructor @AllArgsConstructor @Builder @Value class ConstructorsW
|
||||
final ConstructorsWithBuilderDefaults other = (ConstructorsWithBuilderDefaults) o;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
if ((this.getY() != other.getY()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
result = ((result * PRIME) + this.getY());
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("ConstructorsWithBuilderDefaults(x=" + this.getX()) + ")");
|
||||
return (((("ConstructorsWithBuilderDefaults(x=" + this.getX()) + ", y=") + this.getY()) + ")");
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") ConstructorsWithBuilderDefaults() {
|
||||
super();
|
||||
this.y = 0;
|
||||
this.x = ConstructorsWithBuilderDefaults.$default$x();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") ConstructorsWithBuilderDefaults(final int x) {
|
||||
public @java.lang.SuppressWarnings("all") ConstructorsWithBuilderDefaults(final int x, final int y) {
|
||||
super();
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user