Interface ConfigEvent


  • public interface ConfigEvent
    This events are triggered from the Config class each time something is added, updated or removed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int VALUE_ADDED
      A new value was added to the Config object
      static int VALUE_REMOVED
      A value as been removed from the Config object
      static int VALUE_UPDATED
      An existing value was updated
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getChangedKey()
      Retrieves the key that triggered the event
      int getChangeType()
      Retrieves the type of change that has happened
      java.lang.Object getNewValue()
      Retrieves the new value associated with this key
      java.lang.Object getOldValue()
      Retrieves the old value associated with this key
      boolean isKey​(java.lang.String key)
      Tells if the value affects a given key, basically:
    • Method Detail

      • isKey

        boolean isKey​(java.lang.String key)
        Tells if the value affects a given key, basically:
         if (evt.isKey("my.key")){
             //...
         }
        
         is equivalent to:
        
         if (evt.getChangedKey().equals("my.key") {
             //...
         }
         
        Parameters:
        key - the key to compare
        Returns:
        true if key is the key that triggered the event and false otherwise
        See Also:
        getChangedKey()
      • getChangedKey

        java.lang.String getChangedKey()
        Retrieves the key that triggered the event
        Returns:
        key
      • getOldValue

        java.lang.Object getOldValue()
        Retrieves the old value associated with this key
        Returns:
        old value
      • getNewValue

        java.lang.Object getNewValue()
        Retrieves the new value associated with this key
        Returns:
        new value