Skip to content

vlcheong/LazyInit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

LazyInit

LazyInit is a helper class that provides lazy initlization of singleton object feature.
Example:
Template is the object I need to create.

The LazyInit accepts Supplier as an argument.
LazyInit<Template> lazy = LazyInit.of(Template::new);

The lazy object is thread safe and the Template object returned by the lazy instance is always same.
Template template = lazy.getOrCreate();
template.print();

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages