Package com.helger.commons.wrapper
Class Wrapper<DATATYPE>
java.lang.Object
com.helger.commons.wrapper.Wrapper<DATATYPE>
- Type Parameters:
DATATYPE- The type of object to be wrapped.
- All Implemented Interfaces:
ICloneable<Wrapper<DATATYPE>>,IMutableWrapper<DATATYPE>,IWrapper<DATATYPE>,Supplier<DATATYPE>
@NotThreadSafe
public class Wrapper<DATATYPE>
extends Object
implements IMutableWrapper<DATATYPE>, ICloneable<Wrapper<DATATYPE>>
This is a stupid wrapper around any object. Its original purpose was the
encapsulation of return values from within an anonymous class.
- Author:
- Philip Helger
-
Constructor Details
-
Wrapper
public Wrapper()Default constructor. Wraps anullvalues. -
Wrapper
Constructor with an existing object.- Parameters:
aObj- The existing object. May benull.
-
Wrapper
Copy constructor. Only takes wrappers of the same type.- Parameters:
aRhs- The other wrapper to use. May not benull.
-
-
Method Details
-
get
-
set
Description copied from interface:IMutableWrapperChange the wrapped object.- Specified by:
setin interfaceIMutableWrapper<DATATYPE>- Parameters:
aObj- The new object to be wrapped. May benull.- Returns:
EChange
-
getClone
- Specified by:
getClonein interfaceICloneable<DATATYPE>- Returns:
- A 100% deep-copy of the implementing class.
-
equals
-
hashCode
public int hashCode() -
toString
-