All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.salomonbrys.kodein.erasedComp.kt Maven / Gradle / Ivy

The newest version!
package com.github.salomonbrys.kodein

/**
 * Creates a [CompositeTypeToken] for an erased generic type.
 *
 * Example: to create an erased type token representing `Set`, use `erasedComp1, String>()`.
 *
 * @param T The main type represented by this type token.
 * @param A1 The type parameter of the main type.
 */
inline fun  erasedComp1() = CompositeTypeToken(erased(), erased())

/**
 * Creates a [CompositeTypeToken] for an erased generic type.
 *
 * Example: to create an erased type token representing `Map`, use `erasedComp2, Int, String>()`.
 *
 * @param T The main type represented by this type token.
 * @param A1 The first type parameter of the main type.
 * @param A2 The second type parameter of the main type.
 */
inline fun  erasedComp2() = CompositeTypeToken(erased(), erased(), erased())

/**
 * Creates a [CompositeTypeToken] for an erased generic type.
 *
 * Example: to create an erased type token representing `Triple`, use `erasedComp3, Int, String, Int>()`.
 *
 * @param T The main type represented by this type token.
 * @param A1 The type parameter of the main type.
 * @param A2 The second type parameter of the main type.
 * @param A3 The third type parameter of the main type.
 */
inline fun  erasedComp3() = CompositeTypeToken(erased(), erased(), erased(), erased())

/**
 * Creates a [CompositeTypeToken] that defines a `Set`.
 *
 * @param T The parameter type of the set.
 */
inline fun  erasedSet() = erasedComp1, T>()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy