Skip to content

abaddon/kustomCompare

Repository files navigation

kustomCompare

Maven Central Java CI with Gradle codecov

A library to compare classes

Example

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())

About

A library to compare classes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages