View Javadoc

1   package org.dfdaemon.il2.api.command.reply;
2   
3   /**
4    * @author aka50
5    */
6   public class MissionInfo {
7   
8       private String path;
9       private MissionState state;
10  
11      public enum MissionState {
12          NONE,
13          LOADED,
14          PLAYING
15      }
16  
17  
18      public MissionInfo() {
19      }
20  
21      public MissionInfo(String path, MissionState state) {
22          this.setPath(path);
23          this.setState(state);
24      }
25  
26  
27      public String getPath() {
28          return path;
29      }
30  
31      public void setPath(String path) {
32          this.path = path;
33      }
34  
35      public MissionState getState() {
36          return state;
37      }
38  
39      public void setState(MissionState state) {
40          this.state = state;
41      }
42  
43      @SuppressWarnings({"RedundantIfStatement"})
44      public boolean equals(Object o) {
45          if (this == o) return true;
46          if (o == null || getClass() != o.getClass()) return false;
47  
48          MissionInfo that = (MissionInfo) o;
49  
50          if (getPath() != null ? !getPath().equals(that.getPath()) : that.getPath() != null) return false;
51          if (getState() != that.getState()) return false;
52  
53          return true;
54      }
55  
56      public int hashCode() {
57          int result;
58          result = (getPath() != null ? getPath().hashCode() : 0);
59          result = 31 * result + (getState() != null ? getState().hashCode() : 0);
60          return result;
61      }
62  
63  
64      public String toString() {
65          final StringBuilder sb = new StringBuilder();
66          sb.append("MissionInfo");
67          sb.append("{");
68          sb.append("path='").append(getPath()).append('\'');
69          sb.append(", state=").append(getState());
70          sb.append('}');
71          return sb.toString();
72      }
73  }