Package com.pnfsoftware.jeb.util.base
Class Wrapper<T>
java.lang.Object
com.pnfsoftware.jeb.util.base.Wrapper<T>
- Type Parameters:
T- wrapped value type
Wrap an object. Akin to
Optional with support for null. This class implements
hashCode() and equals(Object).-
Field Summary
Fields -
Method Summary
-
Field Details
-
NULL
Shared wrapper for a null value.
-
-
Method Details
-
wrap
Wrap a value.- Type Parameters:
T- wrapped value type- Parameters:
object- value to wrap- Returns:
- a wrapper for the provided value
-
get
Retrieve the wrapped value.- Returns:
- the wrapped value, which may be null if null was wrapped
-
hashCode
public int hashCode() -
equals
-
toString
-