Package com.globalmentor.model
Class AbstractObjectDecorator<T>
java.lang.Object
com.globalmentor.model.AbstractObjectDecorator<T>
- Type Parameters:
T
- The type of object being decorated.
- Direct Known Subclasses:
ObjectDecorator
,ObjectHolder
An object that decorates another object, preserving the
Object.hashCode()
and Object.equals(Object)
of the decorated object. Equality is only
supported for exact top-level types.- Author:
- Garret Wilson
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AbstractObjectDecorator
Decorated object constructor.- Parameters:
decoratedObject
- The object to decorate.
-
-
Method Details
-
getObject
- Returns:
- The decorated object.
-
setObject
Sets the decorated object.- Parameters:
decoratedObject
- The object to decorate.
-
hashCode
public int hashCode() -
equals
- Overrides:
equals
in classObject
- Implementation Specification:
- This version considers the given object equal to this object if it is of the same type as this object, and this object's decorated object's
Object.equals(Object)
method also returnstrue
for the objects's decorated object or both decorated objects arenull
.
-
toString
-