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
An ApplicationEvent that carries an arbitrary payload.
Since:
4.2
Author:
Stephane Nicoll, Juergen Hoeller, Qimiao Chen
See Also:
  • Constructor Details

    • PayloadApplicationEvent

      public PayloadApplicationEvent(Object source, T payload, @Nullable ResolvableType payloadType)
      Create a new PayloadApplicationEvent.
      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)
    • PayloadApplicationEvent

      public PayloadApplicationEvent(Object source, T payload)
      Create a new PayloadApplicationEvent, using the instance to infer its type.
      Parameters:
      source - the object on which the event initially occurred (never null)
      payload - the payload object (never null)
  • Method Details