generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Thank you for this outstanding tutorial.
I am restricted to Java 11 for now. To do this I made simple updates to 2 files: pom.xml and HelloAppController.java.
pom.xml
Replace 17 with 11.
<maven.compiler.release>11</maven.compiler.release>
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
HelloAppController.java
Replace private record Response (String message) {...}
with
public class Response {
String message;
public Response(String message) {
Objects.requireNonNull(message);
this.message = message;
}
public boolean isValid() {
return true;
}
public String getMessage() { return this.message; }
@Override
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null || obj.getClass() != this.getClass()) return false;
Response that = (Response) obj;
return this.message == that.message;
}
@Override
public int hashCode() {
return Objects.hash(message);
}
@Override
public String toString() {
return this.message;
}
}
Metadata
Metadata
Assignees
Labels
No labels