/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.config;

import net.ranides.assira.events.Event;

/**
 *
 * @author ranides
 */
public abstract class ConfigEvent implements Event {

    private final Configuration source;

    protected ConfigEvent(Configuration source) {
        this.source = source;
    }

    public static Change change(Configuration source, String branch) {
        return new Change(source, branch);
    }

    public static Save save(Configuration source) {
        return new Save(source);
    }

    public static Load load(Configuration source) {
        return new Load(source);
    }

    public Configuration source() {
        return source;
    }

    public static class Change extends ConfigEvent {

        private final String branch;

        protected Change(Configuration source, String branch) {
            super(source);
            this.branch = branch;
        }

        public String branch() {
            return branch;
        }

    }

    public static class Save extends ConfigEvent {
        protected Save(Configuration source) { super(source); }
    }

    public static class Load extends ConfigEvent {
        protected Load(Configuration source) { super(source); }
    }

}
