Package de.alpharogroup.model.util
Class WildcardListModel<T>
- java.lang.Object
-
- de.alpharogroup.model.GenericModel<T>
-
- de.alpharogroup.model.util.GenericCollectionModel<java.util.List<T>>
-
- de.alpharogroup.model.util.WildcardListModel<T>
-
- Type Parameters:
T
- type of object inside list
- All Implemented Interfaces:
de.alpharogroup.model.api.Attachable
,de.alpharogroup.model.api.Detachable
,de.alpharogroup.model.api.Model<java.util.List<T>>
,de.alpharogroup.model.api.ObjectClassAware<java.util.List<T>>
,java.io.Serializable
public class WildcardListModel<T> extends GenericCollectionModel<java.util.List<T>>
Based onModel
but for lists of serializable objects.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WildcardListModel(java.util.List<T> list)
Creates model that will containlist
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<T>
newSerializableCollectionOf(java.util.List<T> object)
Creates a serializable version of the object.static <C> de.alpharogroup.model.api.Model<java.util.List<C>>
of(java.util.List<C> list)
Factory method for models that contain lists.-
Methods inherited from class de.alpharogroup.model.util.GenericCollectionModel
setObject
-
Methods inherited from class de.alpharogroup.model.GenericModel
attach, detach, getObjectClass, ofCollection, ofList, ofMap, ofSet
-
-
-
-
Constructor Detail
-
WildcardListModel
public WildcardListModel(java.util.List<T> list)
Creates model that will containlist
.- Parameters:
list
- the list
-
-
Method Detail
-
of
public static <C> de.alpharogroup.model.api.Model<java.util.List<C>> of(java.util.List<C> list)
Factory method for models that contain lists. This factory method will automatically rebuild a nonserializablelist
into a serializable one.- Type Parameters:
C
- model type- Parameters:
list
- The List, which may or may not be Serializable- Returns:
- A Model object wrapping the List
-
newSerializableCollectionOf
protected java.util.List<T> newSerializableCollectionOf(java.util.List<T> object)
Creates a serializable version of the object. The object is usually a collection.- Specified by:
newSerializableCollectionOf
in classGenericCollectionModel<java.util.List<T>>
- Parameters:
object
- the object- Returns:
- serializable version of
object
-
-