package de.gecheckt.pdf.umbenenner.adapter.in.gui.editor;

/**
 * Derived change-state view for the editor content.
 * <p>
 * The value is computed from the comparison between the baseline values and the current
 * editor values.
 */
public enum GuiChangeState {

    /** The current editor state matches its baseline. */
    CLEAN,

    /** The current editor state has diverged from its baseline. */
    DIRTY;

    /**
     * Returns whether this state represents unsaved changes.
     *
     * @return {@code true} when the editor is dirty, otherwise {@code false}
     */
    public boolean isDirty() {
        return this == DIRTY;
    }
}
