-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make use of @RecordableConstructor optional when there is a single co…
…nstructor
- Loading branch information
Showing
4 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
core/deployment/src/test/java/io/quarkus/deployment/recording/TestSingleConstructorBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package io.quarkus.deployment.recording; | ||
|
||
import java.util.Objects; | ||
|
||
public class TestSingleConstructorBean { | ||
|
||
private final String first; | ||
private final String last; | ||
private final int age; | ||
|
||
public TestSingleConstructorBean(String first, String last, int age) { | ||
this.first = first; | ||
this.last = last; | ||
this.age = age; | ||
} | ||
|
||
public String getFirst() { | ||
return first; | ||
} | ||
|
||
public String getLast() { | ||
return last; | ||
} | ||
|
||
public int getAge() { | ||
return age; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
TestSingleConstructorBean that = (TestSingleConstructorBean) o; | ||
return age == that.age && | ||
Objects.equals(first, that.first) && | ||
Objects.equals(last, that.last); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(first, last, age); | ||
} | ||
} |