public interface LazyLoader<S,D>
A functional interface that can be used to return data D
from a source S
where implementations are free to define how and when
data is fetched from source as well how it is internally cached.
The source does not need to worry about caching data but always fetch data as demanded. The way data will actually be cached is an implementation detail.
DefaultLazyLoader
Modifier and Type | Method and Description |
---|---|
D |
get(Supplier<S> source)
Returns data from the given
source . |
D get(Supplier<S> source)
source
. Data is only fetched from source
once and only if necessary, it is
up to implementations to decide the momentum to actually fetch data from source.source
- the source from where data will be fetched.Copyright © 2021 JBoss by Red Hat. All rights reserved.