X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fpz2utils4jsf%2Fpazpar2%2Fstate%2FPazpar2State.java;h=4412a7f1694551e17a016c973442f22b4dfffc29;hb=7b4d66a5933f030bef0d2a6074c4cd2fee7d9fbb;hp=fba685e17e2bcd5273176c00f6ccf4872c1544de;hpb=0f71d8e1a79d3d007cc52b58bfe33517a69224b7;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/state/Pazpar2State.java b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/state/Pazpar2State.java index fba685e..4412a7f 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/state/Pazpar2State.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/state/Pazpar2State.java @@ -19,6 +19,13 @@ public class Pazpar2State { key = "#initial"; } + /** + * Creates new state by cloning all commands of the provided state and + * then overriding one of them with the provided state changing command. + * + * @param previousState + * @param newCommand + */ public Pazpar2State (Pazpar2State previousState, Pazpar2Command newCommand) { for (String commandName : previousState.commands.keySet()) { this.commands.put(commandName, previousState.commands.get(commandName).copy()); @@ -50,7 +57,7 @@ public class Pazpar2State { } /** - * Checks if the provided command represents a state change + * Checks if a command represents a change of this state * * @param command * @return true if the command causes a change of state @@ -67,6 +74,12 @@ public class Pazpar2State { } } + /** + * Returns a command from this state + * + * @param name + * @return + */ public Pazpar2Command getCommand(String name) { return commands.get(name); }