Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.16 KB

README.md

File metadata and controls

33 lines (23 loc) · 1.16 KB

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