package brooklyn.entity.trait;

import groovy.lang.Closure;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import brooklyn.util.internal.SerializableObservableList;
import brooklyn.util.internal.SerializableObservableMap;

/**
 * A collection of entities that can change.
 */
public interface Changeable {
    /**
     * Allows casting a {@link Closure} to a {@link PropertyChangeListener}.
     */
    class ClosurePropertyChangeListener implements PropertyChangeListener {
        Closure<Void> closure;
        public ClosurePropertyChangeListener(Closure<Void> c) { closure = c; }
        public void propertyChange(PropertyChangeEvent event) {
            closure.call(event);
        }
    }

    /**
     * Implement this method to add a {@link PropertyChangeListener} on
     * some collection of entities.
     *
     * The entity collection should be a {@link SerializableObservableList}
     * or a {@link SerializableObservableMap} wrapper.
     */
    public void addEntityChangeListener(PropertyChangeListener listener);
}

@@ -29,76 +29,8 @@
 t;%0A%0A
-import groovy.lang.Closure;%0A%0Aimport java.beans.PropertyChangeEvent;%0A
 impo
@@ -271,401 +271,8 @@
 e %7B%0A
-    /**%0A     * Allows casting a %7B@link Closure%7D to a %7B@link PropertyChangeListener%7D.%0A     */%0A    class ClosurePropertyChangeListener implements PropertyChangeListener %7B%0A        Closure%3CVoid%3E closure;%0A        public ClosurePropertyChangeListener(Closure%3CVoid%3E c) %7B closure = c; %7D%0A        public void propertyChange(PropertyChangeEvent event) %7B%0A            closure.call(event);%0A        %7D%0A    %7D%0A%0A
     

Remove cargo-cult copypasta