Package org.springframework.context
Class PayloadApplicationEvent<T>
- java.lang.Object
- java.util.EventObject
- org.springframework.context.ApplicationEvent
- org.springframework.context.PayloadApplicationEvent<T>
- Type Parameters:
T
- the payload type of the event
- All Implemented Interfaces:
Serializable
,ResolvableTypeProvider
public class PayloadApplicationEvent<T> extends ApplicationEvent implements ResolvableTypeProvider
AnApplicationEvent
that carries an arbitrary payload.Mainly intended for internal use within the framework.
- Since:
- 4.2
- Author:
- Stephane Nicoll
- See Also:
- Serialized Form
Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
Constructors Constructor Description PayloadApplicationEvent(Object source, T payload)
Create a new PayloadApplicationEvent.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getPayload()
Return the payload of the event.ResolvableType
getResolvableType()
Return theResolvableType
describing this instance (ornull
if some sort of default should be applied instead).Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
Constructor Detail
PayloadApplicationEvent
public PayloadApplicationEvent(Object source, T payload)
Create a new PayloadApplicationEvent.- Parameters:
source
- the object on which the event initially occurred (nevernull
)payload
- the payload object (nevernull
)
Method Detail
getResolvableType
public ResolvableType getResolvableType()
Description copied from interface:ResolvableTypeProvider
Return theResolvableType
describing this instance (ornull
if some sort of default should be applied instead).- Specified by:
getResolvableType
in interfaceResolvableTypeProvider
getPayload
public T getPayload()
Return the payload of the event.