Package edu.hm.hafner.util
Class Deferred<T>
java.lang.Object
edu.hm.hafner.util.Deferred<T>
- Type Parameters:
T- type of the instance
Deferred element wrapper of a singleton instance. Creates a constant instance when it is accessed the first time.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Deferred
Creates a new instance that creates a singleton when it is accessed the first time.- Parameters:
supplier- the supplier to create the instance
-
-
Method Details
-
get
Returns the instance. If not yet created the instance will be created.- Returns:
- the instance
-