Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mechero/sb2.5_java17
Updated to Spring Boot 2.5, JUnit 5, Java 17
- Loading branch information
Showing
7 changed files
with
9 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,6 @@ | ||
package io.tpd.superheroes.domain; | ||
|
||
public final class SuperHero { | ||
|
||
private String firstName; | ||
private String lastName; | ||
private String heroName; | ||
|
||
// Empty constructor is needed for Jackson to recreate the object from JSON | ||
public SuperHero() { | ||
} | ||
|
||
public SuperHero(String firstName, String lastName, String heroName) { | ||
this.firstName = firstName; | ||
this.lastName = lastName; | ||
this.heroName = heroName; | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public String getHeroName() { | ||
return heroName; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
SuperHero superHero = (SuperHero) o; | ||
|
||
if (firstName != null ? !firstName.equals(superHero.firstName) : superHero.firstName != null) return false; | ||
if (lastName != null ? !lastName.equals(superHero.lastName) : superHero.lastName != null) return false; | ||
return heroName != null ? heroName.equals(superHero.heroName) : superHero.heroName == null; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = firstName != null ? firstName.hashCode() : 0; | ||
result = 31 * result + (lastName != null ? lastName.hashCode() : 0); | ||
result = 31 * result + (heroName != null ? heroName.hashCode() : 0); | ||
return result; | ||
} | ||
public record SuperHero(String firstName, | ||
String lastName, | ||
String heroName) { | ||
} |
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
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