Store/store-kotlin/README.md
Jorge Antonio Díaz-Benito Soriano 10d0cf6d07 Add store-kotlin module (#229)
* Add store-kotlin module

* Remove useless file

* Fix package in AndroidManifest

* Refactor module tests to assertJ

* Remove wrong annotation

* Add store-kotlin artifact to README

* Add module README

* Add KDoc to Javadoc jar

* Add Experimental annotation

* Mark all public store-kotlin classes as @Experimental

* Replace use of rx's @Experimental with local one instead
2017-06-22 21:22:34 -04:00

902 B

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!