|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.model.Model<T>
T
- The type of the Model Objectpublic class Model<T extends Serializable>
Model
is the basic implementation of an IModel
. It just wraps a simple
model object. The model object must be serializable, as it is stored in the session. If you have
large objects to store, consider using LoadableDetachableModel
instead of this class.
Constructor Summary | |
---|---|
Model()
Construct the model without providing an object. |
|
Model(T object)
Construct the model, setting the given object as the wrapped object. |
Method Summary | ||
---|---|---|
void |
detach()
Detaches model after use. |
|
boolean |
equals(Object obj)
|
|
T |
getObject()
Gets the model object. |
|
Object |
getObject(Component component)
Deprecated. replace by IModel.getObject() . |
|
int |
hashCode()
|
|
static
|
of()
Factory methods for Model which uses type inference to make code shorter. |
|
static
|
of(Collection<? extends C> set)
Factory method for models that contain collections. |
|
static
|
of(List<? extends C> list)
Deprecated. see ofList(List) |
|
static
|
of(Map<K,V> map)
Deprecated. use ofMap(Map) |
|
static
|
of(Set<? extends C> set)
Deprecated. replace by ofSet(java.util.Set) . |
|
static
|
of(T object)
Factory methods for Model which uses type inference to make code shorter. |
|
static
|
ofList(List<? extends C> list)
Factory method for models that contain lists. |
|
static
|
ofMap(Map<K,V> map)
Factory method for models that contain maps. |
|
static
|
ofSet(Set<? extends C> set)
Factory method for models that contain sets. |
|
void |
setObject(Component component,
Object object)
Deprecated. replace by IModel.setObject(Object) . |
|
void |
setObject(T object)
Set the model object; calls setObject(java.io.Serializable). |
|
String |
toString()
|
|
static
|
valueOf(List<? extends C> list)
Deprecated. see of(List) |
|
static
|
valueOf(Map<K,V> map)
Deprecated. see of(Map) |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Model()
public Model(T object)
object
- The model object properMethod Detail |
---|
@Deprecated public static <K,V> IModel<Map<K,V>> valueOf(Map<K,V> map)
of(Map)
K
- type of key inside mapV
- type of value inside mapmap
- The Map, which may or may not be Serializable
@Deprecated public static <C> IModel<List<? extends C>> valueOf(List<? extends C> list)
of(List)
C
- type of object inside listlist
- The List, which may or may not be Serializable
@Deprecated public static <C> IModel<List<? extends C>> of(List<? extends C> list)
ofList(List)
list
into a serializable one.
C
- model typelist
- The List, which may or may not be Serializable
public static <C> IModel<List<? extends C>> ofList(List<? extends C> list)
list
into a serializable one.
C
- model typelist
- The List, which may or may not be Serializable
@Deprecated public static <K,V> IModel<Map<K,V>> of(Map<K,V> map)
ofMap(Map)
map
into a serializable one.
K
- key type in mapV
- value type in mapmap
- The Map, which may or may not be Serializable
public 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 Serializable
@Deprecated public static <C> IModel<Set<? extends C>> of(Set<? extends C> set)
ofSet(java.util.Set)
.
set
into a serializable one.
C
- model typeset
- The Set, which may or may not be Serializable
public static <C> IModel<Set<? extends C>> ofSet(Set<? extends C> set)
set
into a serializable one.
C
- model typeset
- The Set, which may or may not be Serializable
public static <C> IModel<Collection<? extends C>> of(Collection<? extends C> set)
collection
into a serializable ArrayList
.
C
- model typeset
- The Collection, which may or may not be Serializable
public static <T extends Serializable> Model<T> of(T object)
new Model(object)
.
T
- object
-
object
public static <T extends Serializable> Model<T> of()
new Model()
.
T
- object
-
object
public T getObject()
IModel
getObject
in interface IModel<T extends Serializable>
IModel.getObject()
public void setObject(T object)
setObject
in interface IModel<T extends Serializable>
object
- the model objectIModel.setObject(Object)
public void detach()
IDetachable
detach
in interface IDetachable
IDetachable.detach()
public String toString()
toString
in class Object
Object.toString()
@Deprecated public final Object getObject(Component component)
IModel.getObject()
.
component
-
@Deprecated public final void setObject(Component component, Object object)
IModel.setObject(Object)
.
component
- object
- public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |