Package io.github.astrapi69.model
Class ChainingModel<T>
- java.lang.Object
-
- io.github.astrapi69.model.ChainingModel<T>
-
- Type Parameters:
T
- the generic type of the model object
- All Implemented Interfaces:
Attachable
,IChainingModel<T>
,IDetachable
,IModel<T>
,java.io.Serializable
- Direct Known Subclasses:
AbstractPropertyModel
public class ChainingModel<T> extends java.lang.Object implements IChainingModel<T>
The classChainingModel
is the default implementation ofIChainingModel
interface.- See Also:
AbstractPropertyModel
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChainingModel(java.lang.Object target)
Instantiates a newChainingModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attach()
Attach an object.void
detach()
Unsets this property model's instance variables and detaches the model.IModel<?>
getChainedModel()
Gets the chained model.T
getObject()
Gets the model object.protected java.lang.Object
getTarget()
void
setChainedModel(IModel<?> model)
Sets the chained model.void
setObject(T object)
Sets the model object.protected ChainingModel<T>
setTarget(java.lang.Object modelObject)
Sets a new target - object or model.java.lang.String
toString()
-
-
-
Constructor Detail
-
ChainingModel
public ChainingModel(java.lang.Object target)
Instantiates a newChainingModel
.- Parameters:
target
- the target object
-
-
Method Detail
-
attach
public void attach()
Attach an object.- Specified by:
attach
in interfaceAttachable
-
detach
public void detach()
Unsets this property model's instance variables and detaches the model.- Specified by:
detach
in interfaceIDetachable
-
getChainedModel
public IModel<?> getChainedModel()
Gets the chained model.- Specified by:
getChainedModel
in interfaceIChainingModel<T>
- Returns:
- the chained model
-
setChainedModel
public void setChainedModel(IModel<?> model)
Sets the chained model.- Specified by:
setChainedModel
in interfaceIChainingModel<T>
- Parameters:
model
- the new chained model
-
getObject
public T getObject()
Gets the model object.
-
setObject
public void setObject(T object)
Sets the model object.
-
getTarget
protected final java.lang.Object getTarget()
- Returns:
- The target - object or model
-
setTarget
protected final ChainingModel<T> setTarget(java.lang.Object modelObject)
Sets a new target - object or model.- Parameters:
modelObject
- the model object- Returns:
- this object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-