1 package org.dfdaemon.il2.api.command.request;
2
3 import org.dfdaemon.il2.api.command.Command;
4 import org.dfdaemon.il2.api.command.reply.MissionInfo;
5
6
7
8
9 public class MissionActionCmd extends Command<MissionInfo> {
10 public enum Action {
11 BEGIN,
12 END,
13 LOAD
14 }
15
16 public final Action action;
17 public String path;
18
19
20 public MissionActionCmd(Action action) {
21 this.action = action;
22 }
23
24 public MissionActionCmd(String path) {
25 this.action = Action.LOAD;
26 this.path = path;
27 }
28
29 public MissionActionCmd(Action action, String path) {
30 this.action = action;
31 this.path = path;
32 }
33
34
35 public boolean equals(Object o) {
36 if (this == o) return true;
37 if (o == null || getClass() != o.getClass()) return false;
38
39 MissionActionCmd that = (MissionActionCmd) o;
40
41 return action == that.action && !(path != null ? !path.equals(that.path) : that.path != null);
42
43 }
44
45 public int hashCode() {
46 int result;
47 result = action.hashCode();
48 result = 31 * result + (path != null ? path.hashCode() : 0);
49 return result;
50 }
51
52 public String toString() {
53 final StringBuilder sb = new StringBuilder();
54 sb.append("MissionActionCmd");
55 sb.append("{");
56 sb.append("action=").append(action);
57 sb.append(", path='").append(path).append('\'');
58 sb.append('}');
59 return sb.toString();
60 }
61 }