Package io.github.astrapi69.model.util
Class GenericCollectionModel<T>
- java.lang.Object
-
- io.github.astrapi69.model.GenericModel<T>
-
- io.github.astrapi69.model.util.GenericCollectionModel<T>
-
- Type Parameters:
T
- the generic type of the model object
- All Implemented Interfaces:
Attachable
,IDetachable
,IModel<T>
,IObjectClassAwareModel<T>
,java.io.Serializable
- Direct Known Subclasses:
CollectionModel
,ListModel
,MapModel
,SetModel
,WildcardCollectionModel
,WildcardListModel
,WildcardSetModel
public abstract class GenericCollectionModel<T> extends GenericModel<T>
The classGenericCollectionModel
is the base class for wild card collections that contains object that do not appear to implement theSerializable
interface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericCollectionModel()
GenericCollectionModel(T object)
Instantiates a newGenericCollectionModel
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
int
hashCode()
protected abstract T
newSerializableCollectionOf(T object)
Creates a serializable version of the object.void
setObject(T object)
Backing object.java.lang.String
toString()
-
Methods inherited from class io.github.astrapi69.model.GenericModel
attach, detach, getObject, getObjectClass, ofCollection, ofList, ofMap, ofSet
-
-
-
-
Constructor Detail
-
GenericCollectionModel
public GenericCollectionModel(T object)
Instantiates a newGenericCollectionModel
.- Parameters:
object
- the object
-
GenericCollectionModel
public GenericCollectionModel()
-
-
Method Detail
-
newSerializableCollectionOf
protected abstract T newSerializableCollectionOf(T object)
Creates a serializable version of the object. The object is usually a collection.- Parameters:
object
- the object- Returns:
- serializable version of
object
-
setObject
public void setObject(T object)
Backing object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classGenericModel<T>
-
canEqual
protected boolean canEqual(java.lang.Object other)
- Overrides:
canEqual
in classGenericModel<T>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGenericModel<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classGenericModel<T>
-
-