Skip to content

Support for null values and loader in the constructor #40

@pramod-knidal

Description

@pramod-knidal
  1. In the current implementation null is returned when an element is not in the cache. There are use cases where the actual value itself is null. Support for null values would be good.

  2. The overloaded get method accepts a suspendable loader function. Writing get(key, () -> Value) in every place makes the code too verbose when the loading logic is same for all calls. So, having a cache which accepts loader in the constructor to create value in the cache if it doesn't already have would be nice.

We have implemented a wrapper with a getValue method which returns the value or null to solve these problems. Having such an API as part of the library would be good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions