ingo@106: package de.intevation.flys.artifacts.transitions; ingo@106: ingo@107: import de.intevation.artifactdatabase.state.State; ingo@107: import de.intevation.artifactdatabase.transition.Transition; ingo@106: ingo@106: /** ingo@106: * The default implementation of a Transition. ingo@106: * ingo@106: * @author Ingo Weinzierl ingo@106: */ ingo@106: public class DefaultTransition implements Transition { ingo@106: ingo@106: /** The ID of the current state */ ingo@106: protected String from; ingo@106: ingo@106: /** The ID of the target state */ ingo@106: protected String to; ingo@106: ingo@106: ingo@106: /** ingo@106: * The default constructor. ingo@106: */ ingo@106: public DefaultTransition() { ingo@106: } ingo@106: ingo@106: ingo@106: /** ingo@106: * The default constructor. ingo@106: * ingo@106: * @param from The current state. ingo@106: * @param to The target state. ingo@106: */ ingo@106: public DefaultTransition(String from, String to) { ingo@106: this.from = from; ingo@106: this.to = to; ingo@106: } ingo@106: ingo@106: ingo@106: /** ingo@106: * Returns the current state ID. ingo@106: * ingo@106: * @return the current state ID. ingo@106: */ ingo@106: public String getFrom() { ingo@106: return from; ingo@106: } ingo@106: ingo@106: ingo@106: /** ingo@106: * Returns the target state ID. ingo@106: * ingo@106: * @return the target state ID. ingo@106: */ ingo@106: public String getTo() { ingo@106: return to; ingo@106: } ingo@106: ingo@106: ingo@106: /** ingo@106: * Set the current state ID. ingo@106: * ingo@106: * @param to the current state ID. ingo@106: */ ingo@106: public void setFrom(String from) { ingo@106: this.from = from; ingo@106: } ingo@106: ingo@106: ingo@106: /** ingo@106: * Set the target state ID. ingo@106: * ingo@106: * @param to the target state ID. ingo@106: */ ingo@106: public void setTo(String to) { ingo@106: this.to = to; ingo@106: } ingo@106: ingo@106: ingo@106: /** ingo@106: * This method always returns true. ingo@106: * ingo@106: * @param state The target state. ingo@106: * ingo@106: * @return true. ingo@106: */ ingo@106: public boolean isValid(State state) { ingo@106: return true; ingo@106: } ingo@106: } ingo@106: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :