This documentation is for an old version of fiftyfive-wicket (2.0.9).


fiftyfive.wicket.test
Class TransientModel<T>

java.lang.Object
  extended by fiftyfive.wicket.test.TransientModel<T>
All Implemented Interfaces:
Serializable, IClusterable, IDetachable, IModel<T>

public class TransientModel<T>
extends Object
implements IModel<T>

Holds a value that will not be serialized. This is helpful in unit tests where you need to construct a quick and dirty model for a non-serializable object, and therefore Model.of() will not work. This class is not intended for production code.

Since:
2.0.2
See Also:
Serialized Form

Constructor Summary
TransientModel(T value)
          Constructs a model that will hold the given value.
 
Method Summary
 void detach()
           
 T getObject()
           
static
<T> TransientModel<T>
of(T value)
          Convience method for constructing a TransientModel instance.
 void setObject(T value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransientModel

public TransientModel(T value)
Constructs a model that will hold the given value.

Method Detail

of

public static <T> TransientModel<T> of(T value)
Convience method for constructing a TransientModel instance. These statements are equivalent:
 IModel<String> = TransientModel.of(value);
 IModel<String> = new TransientModel<String>(value);


getObject

public T getObject()
Specified by:
getObject in interface IModel<T>

setObject

public void setObject(T value)
Specified by:
setObject in interface IModel<T>

detach

public void detach()
Specified by:
detach in interface IDetachable


Copyright © 2011 55 Minutes. All Rights Reserved.