Matcher

constructor(clazz: KClass<ChildClazz>, value: SuperClazz? = null)

Parameters

clazz

The class we're trying to match against with the matches(value: SuperClazz) function

value

The value we're trying to match against with the equals() function. We need this to determine whether two Matchers are equal when the Matcher is built using Enum values. When using Enum values, KClass is identical for all the values (it's the enum class). In this case we use the value parameter which is identical to the Enum value itself (not the Enum class).