Store/store-kotlin
2017-11-18 16:03:18 +01:00
..
src Remove @Experimental from store-kotlin API 2017-11-18 16:03:18 +01:00
build.gradle Gradle updates (#266) 2017-08-17 13:48:12 -04:00
gradle.properties Add store-kotlin module (#229) 2017-06-22 21:22:34 -04:00
README.md Add store-kotlin module (#229) 2017-06-22 21:22:34 -04:00

store-kotlin

Store with bindings for Kotlin.

Usage

StoreBuilder:

FluentStoreBuilder.barcode(myFetcher) {
    persister = myPersister
    memoryPolicy = myMemoryPolicy
    stalePolicy = myStalePolicy
}
FluentStoreBuilder.key().fetcher(myFetcher) {
    persister = myPersister
    memoryPolicy = myMemoryPolicy
    stalePolicy = myStalePolicy
}
FluentStoreBuilder.parsedWithKey<Key, Raw, Parsed>(myFetcher) {
    persister = myPersister
    memoryPolicy = myMemoryPolicy
    stalePolicy = myStalePolicy
    parser = myParser
    parsers = myParsers
}

MemoryPolicyBuilder:

FluentMemoryPolicyBuilder.build {
    expireAfterWrite = expireAfterWriteValue
    expireAfterAccess = expireAfterWriteAccess
    expireAfterTimeUnit = expireAfterTimeUnitValue
    memorySize = maxSizeValue
}

And you can always omit the configuration block if you're happy with the defaults!