Class BeanPropertyChangedEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class BeanPropertyChangedEvent
    extends org.springframework.context.ApplicationEvent
    An event that is published when a property of a bean changes.

    This event provides details about the bean whose property changed, the name of the property, and the old and new values of the property. It can be used to track changes in bean properties during runtime.

    Example usage:

     // Create and publish the event when a bean's property changes
     BeanPropertyChangedEvent event = new BeanPropertyChangedEvent(myBean, "status", oldStatus, newStatus);
     applicationEventPublisher.publishEvent(event);
     
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    ApplicationEvent, Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      BeanPropertyChangedEvent​(java.lang.Object bean, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
      The constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getBean()  
      java.lang.Object getNewValue()  
      java.lang.Object getOldValue()  
      java.lang.String getPropertyName()  
      java.lang.String toString()  
      • Methods inherited from class org.springframework.context.ApplicationEvent

        getTimestamp
      • Methods inherited from class java.util.EventObject

        getSource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BeanPropertyChangedEvent

        public BeanPropertyChangedEvent​(java.lang.Object bean,
                                        java.lang.String propertyName,
                                        java.lang.Object oldValue,
                                        java.lang.Object newValue)
        The constructor
        Parameters:
        bean - the source bean
        propertyName - the property name was changed
        oldValue - the property value before changed
        newValue - the property value after changed
    • Method Detail

      • getBean

        public java.lang.Object getBean()
      • getPropertyName

        public java.lang.String getPropertyName()
      • getOldValue

        public java.lang.Object getOldValue()
      • getNewValue

        public java.lang.Object getNewValue()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.EventObject