Created
March 18, 2018 20:30
-
-
Save bogdanalbei/4d40051d43c86dc90a83df8aca887558 to your computer and use it in GitHub Desktop.
Lazy loading supplier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class User { | |
| private long id; | |
| private String name; | |
| private Supplier<List<Wallet>> wallets; | |
| public void setWallets(Supplier<List<Wallet>> wallets) { | |
| this.wallets = wallets; | |
| } | |
| public List<Wallet> getWallets() { | |
| return wallets.get(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment