001package jmri.beans;
002
003import java.beans.PropertyChangeEvent;
004import java.beans.PropertyVetoException;
005
006/**
007 * Interface that defines the methods needed to fire vetoable property changes.
008 *
009 * @author Randall Wood Copyright 2020
010 */
011// This interface exists so that multiple implementations can inherit the Javadocs
012interface VetoableChangeFirer {
013
014    /**
015     * Fire a property change.
016     *
017     * @param propertyName the programmatic name of the property that was
018     *                     changed
019     * @param oldValue     the old value of the property
020     * @param newValue     the new value of the property
021     * @throws PropertyVetoException if one of listeners vetoes the property
022     *                               update
023     */
024    void fireVetoableChange(String propertyName, boolean oldValue, boolean newValue) throws PropertyVetoException;
025
026    /**
027     * Fire a property change.
028     *
029     * @param event the PropertyChangeEvent to be fired
030     * @throws PropertyVetoException if one of listeners vetoes the property
031     *                               update
032     */
033    void fireVetoableChange(PropertyChangeEvent event) throws PropertyVetoException;
034
035    /**
036     * Fire a property change.
037     *
038     * @param propertyName the programmatic name of the property that was
039     *                     changed
040     * @param oldValue     the old value of the property
041     * @param newValue     the new value of the property
042     * @throws PropertyVetoException if one of listeners vetoes the property
043     *                               update
044     */
045    void fireVetoableChange(String propertyName, int oldValue, int newValue) throws PropertyVetoException;
046
047    /**
048     * Fire a property change.
049     *
050     * @param propertyName the programmatic name of the property that was
051     *                     changed
052     * @param oldValue     the old value of the property
053     * @param newValue     the new value of the property
054     * @throws PropertyVetoException if one of listeners vetoes the property
055     *                               update
056     */
057    void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException;
058
059}