T - The type of the Model Objectpublic class GenericModel<T> extends Object implements IObjectClassAwareModel<T>
DefaultModel is the basic implementation of an IModel. It just wraps a
simple model object. If you have large objects to store, consider using
LoadableDetachableModel instead of this class.| Constructor and Description |
|---|
GenericModel()
Construct the model without providing an object.
|
GenericModel(T object)
Construct the model, setting the given object as the wrapped object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
detach()
Detach.
|
Class<T> |
getObjectClass()
Returns the class of model object
|
static <T> GenericModel<T> |
of()
Factory methods for Model which uses type inference to make code shorter.
|
static <C> IModel<Collection<C>> |
of(Collection<C> collection)
Factory method for models that contain collections.
|
static <T> GenericModel<T> |
of(T object)
Factory methods for Model which uses type inference to make code shorter.
|
static <C> IModel<List<C>> |
ofList(List<C> list)
Factory method for models that contain lists.
|
static <K,V> IModel<Map<K,V>> |
ofMap(Map<K,V> map)
Factory method for models that contain maps.
|
static <C> IModel<Set<C>> |
ofSet(Set<C> set)
Factory method for models that contain sets.
|
public GenericModel()
public GenericModel(T object)
object - The model object properpublic static <C> IModel<List<C>> ofList(List<C> list)
list into a serializable one.C - model typelist - The List, which may or may not be Serializablepublic static <K,V> IModel<Map<K,V>> ofMap(Map<K,V> map)
map into a serializable one.K - key type in mapV - value type in mapmap - The Map, which may or may not be Serializablepublic static <C> IModel<Set<C>> ofSet(Set<C> set)
set into a serializable one.C - model typeset - The Set, which may or may not be Serializablepublic static <C> IModel<Collection<C>> of(Collection<C> collection)
collection into a serializable ArrayList.C - model typecollection - The Collection, which may or may not be Serializablepublic static <T> GenericModel<T> of(T object)
new Model<TypeOfObject>(object).T - the generic typeobject - the objectobjectpublic static <T> GenericModel<T> of()
new GenericModel<TypeOfObject>().T - the generic typeobjectpublic void detach()
detach in interface IDetachableIDetachable.detach()public Class<T> getObjectClass()
IObjectClassAwareModelgetObjectClass in interface IObjectClassAwareModel<T>Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.