view flys-artifacts/src/main/java/de/intevation/flys/artifacts/transitions/DefaultTransition.java @ 106:5864c41219db

Initializes a TransitionEngine storing all transitions for each artifact at the application start. flys-artifacts/trunk@1288 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 03 Feb 2011 10:23:30 +0000
parents
children a228b39494a9
line wrap: on
line source
package de.intevation.flys.artifacts.transitions;

import de.intevation.flys.artifacts.states.State;

/**
 * The default implementation of a <code>Transition</code>.
 *
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class DefaultTransition implements Transition {

    /** The ID of the current state */
    protected String from;

    /** The ID of the target state */
    protected String to;


    /**
     * The default constructor.
     */
    public DefaultTransition() {
    }


    /**
     * The default constructor.
     *
     * @param from The current state.
     * @param to The target state.
     */
    public DefaultTransition(String from, String to) {
        this.from = from;
        this.to   = to;
    }


    /**
     * Returns the current state ID.
     *
     * @return the current state ID.
     */
    public String getFrom() {
        return from;
    }


    /**
     * Returns the target state ID.
     *
     * @return the target state ID.
     */
    public String getTo() {
        return to;
    }


    /**
     * Set the current state ID.
     *
     * @param to the current state ID.
     */
    public void setFrom(String from) {
        this.from = from;
    }


    /**
     * Set the target state ID.
     *
     * @param to the target state ID.
     */
    public void setTo(String to) {
        this.to = to;
    }


    /**
     * This method always returns <i>true</i>.
     *
     * @param state The target state.
     *
     * @return true.
     */
    public boolean isValid(State state) {
        return true;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org