Class EntityProxyChange<P extends EntityProxy>
- java.lang.Object
-
- com.google.web.bindery.event.shared.Event<EntityProxyChange.Handler<P>>
-
- com.google.web.bindery.requestfactory.shared.EntityProxyChange<P>
-
- Type Parameters:
P- the type of the proxy
public class EntityProxyChange<P extends EntityProxy> extends Event<EntityProxyChange.Handler<P>>
Event posted by aRequestFactorywhen changes to an entity are detected. Provides aWriteOperationvalue describing the change, and theEntityProxyIdof the entity in question.EntityProxyChange events are posted with the relevant EntityProxy Class as their source, allowing handlers to register for changes only of the type they care about via
registerForProxyType(EventBus, Class, Handler).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEntityProxyChange.Handler<P extends EntityProxy>Implemented by methods that handle EntityProxyChange events.-
Nested classes/interfaces inherited from class com.google.web.bindery.event.shared.Event
Event.Type<H>
-
-
Constructor Summary
Constructors Constructor Description EntityProxyChange(P proxy, WriteOperation writeOperation)Constructs an EntityProxyChange object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddispatch(EntityProxyChange.Handler<P> handler)Implemented by subclasses to to invoke their handlers in a type safe manner.Event.Type<EntityProxyChange.Handler<P>>getAssociatedType()Returns the type associated with this instance.EntityProxyId<P>getProxyId()Returns an unpopulated copy of the changed proxy — all properties are undefined except its id.WriteOperationgetWriteOperation()Returns theWriteOperationassociated with this instance.static <P extends EntityProxy>
HandlerRegistrationregisterForProxyType(EventBus eventBus, java.lang.Class<P> proxyType, EntityProxyChange.Handler<P> handler)Register a handler for a EntityProxyChange events for a particular proxy class.-
Methods inherited from class com.google.web.bindery.event.shared.Event
getSource, setSource, toDebugString, toString
-
-
-
-
Constructor Detail
-
EntityProxyChange
public EntityProxyChange(P proxy, WriteOperation writeOperation)
Constructs an EntityProxyChange object.- Parameters:
proxy- anEntityProxyinstance of type PwriteOperation- aWriteOperationinstance
-
-
Method Detail
-
registerForProxyType
public static <P extends EntityProxy> HandlerRegistration registerForProxyType(EventBus eventBus, java.lang.Class<P> proxyType, EntityProxyChange.Handler<P> handler)
Register a handler for a EntityProxyChange events for a particular proxy class.- Parameters:
eventBus- theEventBusproxyType- a Class instance of type Phandler- anEntityProxyChange.Handlerinstance of type P- Returns:
- an
EntityProxyinstance
-
getAssociatedType
public Event.Type<EntityProxyChange.Handler<P>> getAssociatedType()
Returns the type associated with this instance.- Specified by:
getAssociatedTypein classEvent<EntityProxyChange.Handler<P extends EntityProxy>>- Returns:
- an instance of
Typeof type Handler<P>
-
getProxyId
public EntityProxyId<P> getProxyId()
Returns an unpopulated copy of the changed proxy — all properties are undefined except its id.- Returns:
- an instance of
EntityProxyId<P>
-
getWriteOperation
public WriteOperation getWriteOperation()
Returns theWriteOperationassociated with this instance.- Returns:
- a
WriteOperationinstance
-
dispatch
protected void dispatch(EntityProxyChange.Handler<P> handler)
Description copied from class:EventImplemented by subclasses to to invoke their handlers in a type safe manner. Intended to be called byEventBus.fireEvent(Event)orEventBus.fireEventFromSource(Event, Object).- Specified by:
dispatchin classEvent<EntityProxyChange.Handler<P extends EntityProxy>>- Parameters:
handler- handler- See Also:
EventBus.dispatchEvent(Event, Object)
-
-