WithGLazyFactory

interface WithGLazyFactory : WithGLazy

Extended version of WithGLazy providing additional DSL for customised GLazy fallbacks using providerFactory.

Functions

Link copied to clipboard
open operator fun <T : Any> GStrictLazy<T>.getValue(thisRef: Any?, property: KProperty<*>): T
open operator fun <T : Any> GLazy<T>.getValue(thisRef: Any?, property: KProperty<*>): T?
Link copied to clipboard
open infix fun GLazy<String>.orEnv(key: String): GLazy<String>
open fun <T : Any> GLazy<T>.orEnv(key: String, converter: (String) -> T): GLazy<T>

Registers a new GLazy fallback that will look up an environment variable if base value is missing.

Link copied to clipboard
open infix fun GLazy<String>.orEnvSystemGradlePropertyChain(envKey: String): GLazy<String>

Registers a new GLazy fallback that will look up an env variable then system property and finally gradle property if base value is missing. System key is implied as [envKey].lowercase().replace("_", ".") Gradle key is implied as [envKey].lowercase().replace("_", ".")

open fun GLazy<String>.orEnvSystemGradlePropertyChain(envKey: String, systemKey: String = envKey.lowercase().replace("_", "."), gradleKey: String = systemKey): GLazy<String>
open fun <T : Any> GLazy<T>.orEnvSystemGradlePropertyChain(envKey: String, systemKey: String = envKey.lowercase().replace("_", "."), gradleKey: String = systemKey, converter: (String) -> T): GLazy<T>

Registers a new GLazy fallback that will look up an env variable then system property and finally gradle property if base value is missing.

Link copied to clipboard
open infix fun GLazy<String>.orGradleProperty(key: String): GLazy<String>
open fun <T : Any> GLazy<T>.orGradleProperty(key: String, converter: (String) -> T): GLazy<T>

Registers a new GLazy fallback that will look up a gradle property if base value is missing.

Link copied to clipboard
open infix fun GLazy<String>.orSystemProperty(key: String): GLazy<String>
open fun <T : Any> GLazy<T>.orSystemProperty(key: String, converter: (String) -> T): GLazy<T>

Registers a new GLazy fallback that will look up a system property if base value is missing.

Link copied to clipboard
open operator fun <T : Any> GStrictMutableLazy<T>.setValue(thisRef: Any?, property: KProperty<*>, value: T)
open operator fun <T : Any> GMutableLazy<T>.setValue(thisRef: Any?, property: KProperty<*>, value: T?)

Properties

Link copied to clipboard
@get:Inject
open val objectFactory: ObjectFactory

Automatically injected ObjectFactory used to create new GMutableLazy instances for chaining

Link copied to clipboard
@get:Inject
open val providerFactory: ProviderFactory

Automatically injected ProviderFactory used to create new GLazy instances for chaining

Extensions

Link copied to clipboard
fun <T : Any> WithGLazyFactory.gLazy(value: () -> T): GLazy<T>

Builds an instance of GLazy

Link copied to clipboard
inline fun <T : Any> WithGLazyFactory.gMutableLazy(initial: T? = null): GMutableLazy<T>

Builds an instance of GMutableLazy