ServiceContainer

Functions

Link copied to clipboard
open fun canCreateService(clazz: Class<*>): ServiceError?
abstract fun canCreateService(clazz: KClass<*>): ServiceError?
open fun canCreateService(name: String, requiredType: Class<*>): ServiceError?
abstract fun canCreateService(name: String, requiredType: KClass<*>): ServiceError?
Link copied to clipboard
Link copied to clipboard
open fun <A : Annotation> findAnnotationOnService(name: String, annotationType: Class<A>): A?
abstract fun <A : Annotation> findAnnotationOnService(name: String, annotationType: KClass<A>): A?
Link copied to clipboard
Link copied to clipboard
open fun <T : Any> getInterfacedServices(clazz: Class<T>): List<T>
abstract fun <T : Any> getInterfacedServices(clazz: KClass<T>): List<T>

Filters out interfaced services of that type if they are already being inspected.

Link copied to clipboard

Filters out interfaced services of that type if they are already being inspected.

Link copied to clipboard
open fun <T : Any> getInterfacedServiceTypes(clazz: Class<T>): List<Class<out T>>
abstract fun <T : Any> getInterfacedServiceTypes(clazz: KClass<T>): List<KClass<out T>>
Link copied to clipboard

Filters out interfaced services of that type if they are already being inspected.

Link copied to clipboard
open fun <T : Any> getService(clazz: Class<T>): T
open fun <T : Any> getService(clazz: KClass<T>): T
open fun <T : Any> getService(name: String, requiredType: Class<T>): T
open fun <T : Any> getService(name: String, requiredType: KClass<T>): T
Link copied to clipboard
inline fun <T : Any> ServiceContainer.getService(): T
Link copied to clipboard
Link copied to clipboard
open fun <T : Any> getServiceOrNull(clazz: Class<T>): T?
open fun <T : Any> getServiceOrNull(clazz: KClass<T>): T?
open fun <T : Any> getServiceOrNull(name: String, requiredType: Class<T>): T?
open fun <T : Any> getServiceOrNull(name: String, requiredType: KClass<T>): T?
Link copied to clipboard
Link copied to clipboard
inline operator fun <T : Any> ServiceContainer.getValue(thisRef: Any?, prop: KProperty<*>): T
Link copied to clipboard
inline fun <R : Any> ServiceContainer.lazy(): LazyService<R>
inline fun <R : Any> ServiceContainer.lazy(name: String): LazyService<R>
fun <R : Any> ServiceContainer.lazy(name: String, requiredType: KClass<R>): LazyService<R>
Link copied to clipboard
inline fun <R : Any, U : R> ServiceContainer.lazyOrElse(crossinline block: () -> U): Lazy<R>
inline fun <R : Any, U : R> ServiceContainer.lazyOrElse(name: String, crossinline block: () -> U): Lazy<R>
fun <R : Any, U : R> ServiceContainer.lazyOrElse(clazz: KClass<R>, block: () -> U): Lazy<R>
fun <R : Any, U : R> ServiceContainer.lazyOrElse(name: String, requiredType: KClass<R>, block: () -> U): Lazy<R>
Link copied to clipboard
inline fun <R : Any> ServiceContainer.lazyOrNull(): Lazy<R?>
inline fun <R : Any> ServiceContainer.lazyOrNull(name: String): Lazy<R?>
fun <R : Any> ServiceContainer.lazyOrNull(name: String, requiredType: KClass<R>): Lazy<R?>
Link copied to clipboard
inline fun <T : Any> ServiceContainer.lazyService(name: String? = null): LazyService<T>
fun <T : Any> ServiceContainer.lazyService(clazz: KClass<T>, name: String? = null): LazyService<T>
Link copied to clipboard
open fun <T : Any> peekServiceOrNull(clazz: Class<T>): T?
abstract fun <T : Any> peekServiceOrNull(clazz: KClass<T>): T?
open fun <T : Any> peekServiceOrNull(name: String, requiredType: Class<T>): T?
abstract fun <T : Any> peekServiceOrNull(name: String, requiredType: KClass<T>): T?
Link copied to clipboard
abstract fun putService(t: Any)
abstract fun putService(t: Any, name: String)
Link copied to clipboard
abstract fun <T : Any> putServiceAs(t: T, clazz: Class<out T>)
abstract fun <T : Any> putServiceAs(t: T, clazz: KClass<out T>)
abstract fun <T : Any> putServiceAs(t: T, clazz: KClass<out T>, name: String)
Link copied to clipboard
inline fun <T : Any> ServiceContainer.putServiceAs(t: T)
inline fun <T : Any> ServiceContainer.putServiceAs(t: T, name: String)
Link copied to clipboard
open fun <T : Any> tryGetService(clazz: Class<T>): ServiceResult<T>
abstract fun <T : Any> tryGetService(clazz: KClass<T>): ServiceResult<T>
open fun <T : Any> tryGetService(name: String, requiredType: Class<T>): ServiceResult<T>
abstract fun <T : Any> tryGetService(name: String, requiredType: KClass<T>): ServiceResult<T>
Link copied to clipboard