com.sibvisions.rad.persist.event
Class StorageEvent

java.lang.Object
  extended by com.sibvisions.rad.persist.event.StorageEvent

public class StorageEvent
extends java.lang.Object

The StorageEvent contains information about changes in an IStorage.


Nested Class Summary
static class StorageEvent.ChangedType
          Specifies the type of change.
 
Constructor Summary
StorageEvent(IStorage pStorage, BeanConverter pBeanConverter, StorageEvent.ChangedType pType, IBean pOld, IBean pNew)
          Constructs the DataRowEvent.
StorageEvent(IStorage pStorage, BeanConverter pBeanConverter, StorageEvent.ChangedType pType, java.lang.Object[] pOld, java.lang.Object[] pNew)
          Creates a new instance of StorageEvent.
StorageEvent(IStorage pStorage, BeanConverter pBeanConverter, StorageEvent.ChangedType pType, java.lang.Object pOld, java.lang.Object pNew)
          Creates a new instance of StorageEvent.
 
Method Summary
 IBean getNew()
          Gets the new IBean.
<T> T
getNew(java.lang.Class<T> pClass)
          Gets the new POJO from type <T>.
 java.lang.Object[] getNewAsArray()
          Gets the new row as object array.
 IBean getOld()
          Gets the old IBean.
<T> T
getOld(java.lang.Class<T> pClass)
          Gets the old POJO from type <T>.
 java.lang.Object[] getOldAsArray()
          Gets the old row as object array.
 IStorage getStorage()
          Gets the IStorage that is changed.
 StorageEvent.ChangedType getType()
          Gets the type of change.
 boolean isBeanMode()
          Gets whether this event is based on a bean/object.
 boolean isNewModified()
          Deprecated. With 2.1 onwards.
 boolean isOldModified()
          Deprecated. With 2.1 onwards.
 void setNew(java.lang.Object pNew)
          Deprecated. With 2.1 onwards it is not necessary anymore to set the new row to propagate changes.
 void setOld(java.lang.Object pOld)
          Deprecated. With 2.1 onwards it is not necessary anymore to set the old row to propagate changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageEvent

public StorageEvent(IStorage pStorage,
                    BeanConverter pBeanConverter,
                    StorageEvent.ChangedType pType,
                    java.lang.Object[] pOld,
                    java.lang.Object[] pNew)
Creates a new instance of StorageEvent.

Parameters:
pStorage - the storage.
pBeanConverter - the bean converter.
pType - the type.
pOld - the old.
pNew - the new.

StorageEvent

public StorageEvent(IStorage pStorage,
                    BeanConverter pBeanConverter,
                    StorageEvent.ChangedType pType,
                    IBean pOld,
                    IBean pNew)
Constructs the DataRowEvent.

Parameters:
pStorage - the changed storage.
pBeanConverter - the bean converter to use.
pType - the type of change.
pOld - the old bean or null if old bean is not allowed
pNew - the new bean or null if new bean is not allowed

StorageEvent

public StorageEvent(IStorage pStorage,
                    BeanConverter pBeanConverter,
                    StorageEvent.ChangedType pType,
                    java.lang.Object pOld,
                    java.lang.Object pNew)
Creates a new instance of StorageEvent.

Parameters:
pStorage - the storage.
pBeanConverter - the bean converter.
pType - the type.
pOld - the old.
pNew - the new.
Method Detail

getStorage

public IStorage getStorage()
Gets the IStorage that is changed.

Returns:
the IStorage that is changed.

getType

public StorageEvent.ChangedType getType()
Gets the type of change.

Returns:
the type of change.

setOld

@Deprecated
public void setOld(java.lang.Object pOld)
Deprecated. With 2.1 onwards it is not necessary anymore to set the old row to propagate changes.

Sets the old bean properties.

Parameters:
pOld - the current old bean.

getOld

public IBean getOld()
Gets the old IBean.

Returns:
the old IBean.

getOld

public <T> T getOld(java.lang.Class<T> pClass)
Gets the old POJO from type <T>.

Type Parameters:
T - the type of the POJO.
Parameters:
pClass - the class of the POJO.
Returns:
the new POJO from type <T>.

getOldAsArray

public java.lang.Object[] getOldAsArray()
Gets the old row as object array.

Returns:
the old row as object array.

getNew

public IBean getNew()
Gets the new IBean.

Returns:
the new IBean.

getNew

public <T> T getNew(java.lang.Class<T> pClass)
Gets the new POJO from type <T>.

Type Parameters:
T - the type of the POJO.
Parameters:
pClass - the class of the POJO.
Returns:
the new POJO from type <T>.

getNewAsArray

public java.lang.Object[] getNewAsArray()
Gets the new row as object array.

Returns:
the new row as object array.

setNew

@Deprecated
public void setNew(java.lang.Object pNew)
Deprecated. With 2.1 onwards it is not necessary anymore to set the new row to propagate changes.

Sets the new bean properties.

Parameters:
pNew - the current new bean.

isNewModified

@Deprecated
public boolean isNewModified()
Deprecated. With 2.1 onwards.

Gets whether the new object was modified after creation.

Returns:
true if the new object was modified, false otherwise

isOldModified

@Deprecated
public boolean isOldModified()
Deprecated. With 2.1 onwards.

Gets whether the old object was modified after creation.

Returns:
true if the old object was modified, false otherwise

isBeanMode

public boolean isBeanMode()
Gets whether this event is based on a bean/object.

Returns:
true if this event was created with a bean or POJO, false if it was created with an array of objects


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.