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
An 
ApplicationEvent that carries an arbitrary payload.- Since:
- 4.2
- Author:
- Stephane Nicoll, Juergen Hoeller, Qimiao Chen
- See Also:
- 
Field SummaryFields inherited from class EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionPayloadApplicationEvent(Object source, T payload) Create a new PayloadApplicationEvent, using the instance to infer its type.PayloadApplicationEvent(Object source, T payload, @Nullable ResolvableType payloadType) Create a new PayloadApplicationEvent based on the provided payload type.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the payload of the event.Return theResolvableTypedescribing this instance (ornullif some sort of default should be applied instead).Methods inherited from class ApplicationEventgetTimestampMethods inherited from class EventObjectgetSource, toString
- 
Constructor Details- 
PayloadApplicationEvent
- 
PayloadApplicationEventCreate a new PayloadApplicationEvent based on the provided payload type.- Parameters:
- source- the object on which the event initially occurred (never- null)
- payload- the payload object (never- null)
- payloadType- the type object of payload object (can be- null). Note that this is meant to indicate the payload type (for example,- String), not the full event type (such as- PayloadApplicationEvent<<String>).
- Since:
- 6.0
 
 
- 
- 
Method Details- 
getResolvableTypeDescription copied from interface:ResolvableTypeProviderReturn theResolvableTypedescribing this instance (ornullif some sort of default should be applied instead).- Specified by:
- getResolvableTypein interface- ResolvableTypeProvider
 
- 
getPayloadReturn the payload of the event.
 
-