https://github.com/abaddon/kustomcompare
A library to compare classes
https://github.com/abaddon/kustomcompare
Last synced: 4 months ago
JSON representation
A library to compare classes
- Host: GitHub
- URL: https://github.com/abaddon/kustomcompare
- Owner: abaddon
- License: apache-2.0
- Created: 2022-02-04T13:13:24.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-16T10:42:26.000Z (about 1 year ago)
- Last Synced: 2025-10-07T05:35:52.494Z (9 months ago)
- Language: Kotlin
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kustomCompare
[](https://ossindex.sonatype.org/component/pkg:maven/io.github.abaddon/kustomCompare)
[](https://github.com/abaddon/kustomCompare/actions/workflows/gradle.yml)
[](https://codecov.io/gh/abaddon/kustomCompare)
A library to compare classes
Example
```kotlin
data class User(
val name: String,
val birthdate: Instant
)
val birthdate = Instant.now()
val user1 = UserTest("stefano", Instant.now())
val user2 = UserTest("stefano", Instant.now())
// Define the fields to exclude in the compare
val compareLogicConfig = CompareLogicConfig()
.addMemberToIgnore("birthdate")
// Create che compare
val compareLogic = CompareLogic(compareLogicConfig)
// compare the 2 elements
val result = compareLogic.compare(user1, user2)
assertTrue(result.result())
```