Interface EnvironmentChangeEvent

All Superinterfaces:
ContextEvent, Events.Event

public interface EnvironmentChangeEvent extends ContextEvent
Interface representing an ContextEvent that occurs when an environment property changes.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> void
    applyOnMatch(String property, Consumer<T> action)
    Applies a given action if the specified property name matches and the property value is assignable to the given type.
    Gets the name of the property that changed.
    Gets the value of the property after the change has occurred.
  • Method Details

    • getProperty

      String getProperty()
      Gets the name of the property that changed.
      Returns:
      the name of the changed property
    • getValue

      Object getValue()
      Gets the value of the property after the change has occurred.
      Returns:
      the new value of the changed property
    • applyOnMatch

      default <T> void applyOnMatch(String property, Consumer<T> action)
      Applies a given action if the specified property name matches and the property value is assignable to the given type.
      Type Parameters:
      T - the type parameter.
      Parameters:
      property - the name of the property to check.
      action - the consumer action to be performed if conditions are satisfied.