Skip to content

Instantly share code, notes, and snippets.

@bogdanalbei
Created March 18, 2018 20:30
Show Gist options
  • Select an option

  • Save bogdanalbei/4d40051d43c86dc90a83df8aca887558 to your computer and use it in GitHub Desktop.

Select an option

Save bogdanalbei/4d40051d43c86dc90a83df8aca887558 to your computer and use it in GitHub Desktop.
Lazy loading supplier
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