JAL-3070 core service descriptors for JABAWS services abstracted to jalview.ws.api...
[jalview.git] / src / jalview / ws / api / UIinfo.java
1 package jalview.ws.api;
2
3 /**
4  * Service UI Info { Action, Specific Name of Service, Brief Description }
5  */
6
7 public class UIinfo
8 {
9   private String ServiceType;
10
11   public UIinfo(String serviceType, String action, String name,
12           String description)
13   {
14     this.setServiceType(serviceType == null ? "" : serviceType);
15     this.Action = action == null ? "" : action;
16     this.description = description == null ? "" : description;
17     this.Name = name == null ? "" : name;
18   }
19
20   /**
21    * The type of analysis the service performs
22    */
23   public String getServiceType()
24   {
25     return ServiceType;
26   }
27
28   public void setServiceType(String serviceType)
29   {
30     ServiceType = serviceType;
31   }
32
33   /**
34    * The action when the service performs the analysis
35    */
36   public String getAction()
37   {
38     return Action;
39   }
40
41   public void setAction(String action)
42   {
43     Action = action;
44   }
45
46   /**
47    * name shown to user
48    * 
49    * @return
50    */
51   public String getName()
52   {
53     return Name;
54   }
55
56   public void setName(String name)
57   {
58     Name = name;
59   }
60
61   /**
62    * Detailed description (may include references, URLs, html,etc)
63    * 
64    * @return
65    */
66   public String getDescription()
67   {
68     return description;
69   }
70
71   public void setDescription(String description)
72   {
73     this.description = description;
74   }
75
76   @Override
77   public boolean equals(Object object)
78   {
79     if (object == null || !(object instanceof UIinfo))
80     {
81       return false;
82     }
83     UIinfo other = (UIinfo) object;
84
85     return (ServiceType == null && other.getServiceType() == null
86             || ServiceType != null && other.getServiceType() != null
87                     && ServiceType.equals(other.getServiceType()))
88             && (Name == null && other.getName() == null
89                     || Name != null && other.getName() != null
90                             && Name.equals(other.getName()))
91             && (Action == null && other.getAction() == null
92                     || Action != null && other.getAction() != null
93                             && Action.equals(other.getAction()))
94             && (description == null && other.getDescription() == null
95                     || description != null && other.getDescription() != null
96                             && description.equals(other.getDescription()));
97   }
98
99   String Action;
100
101   String Name;
102
103   String description;
104 }