Matcher

class Matcher<SuperClazz : Any, out ChildClazz : SuperClazz>(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).

Constructors

Link copied to clipboard
constructor(clazz: KClass<ChildClazz>, value: SuperClazz? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard