-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add another test with another object
- Loading branch information
1 parent
04df3fd
commit 24cbb4e
Showing
7 changed files
with
74 additions
and
19 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
35 changes: 35 additions & 0 deletions
35
sadu-jackson-mapper/src/test/java/de/chojo/sadu/jackson/TestObj2.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,35 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.jackson; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.ZoneOffset; | ||
import java.time.temporal.ChronoUnit; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
public record TestObj2(int first, long second, String third, LocalDateTime fourth, UUID fifth) { | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
TestObj2 testObj = (TestObj2) o; | ||
return first == testObj.first && second == testObj.second && Objects.equals(fifth, testObj.fifth) && Objects.equals(third, testObj.third) && Objects.equals(fourth.truncatedTo(ChronoUnit.SECONDS), testObj.fourth.truncatedTo(ChronoUnit.SECONDS)); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = first; | ||
result = 31 * result + Long.hashCode(second); | ||
result = 31 * result + Objects.hashCode(third); | ||
result = 31 * result + Objects.hashCode(fourth.truncatedTo(ChronoUnit.SECONDS)); | ||
result = 31 * result + Objects.hashCode(fifth); | ||
return result; | ||
} | ||
} |
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