View Javadoc

1   package twcsckernel.projectbase.plugins;
2   
3   import java.io.Serializable;
4   
5   public class PluginDescriptor implements Serializable {
6       private static final long serialVersionUID = 1L;
7   
8       public final String author;
9   
10      public final String description;
11  
12      public final String clientPackagePath;
13  
14      public final String serverBuilderPackagePath;
15  
16      public final String serverPackagePath;
17  
18      public final String name;
19  
20      public final boolean isRemote;
21  
22      public PluginDescriptor(String author, String description, String name,
23              String clientPackagePath, String serverPackagePath,
24              boolean isRemote, String serverBuilderPath) {
25          this.author = author;
26          this.description = description;
27          this.name = name;
28          this.clientPackagePath = clientPackagePath;
29          this.serverPackagePath = serverPackagePath;
30          this.isRemote = isRemote;
31          this.serverBuilderPackagePath = serverBuilderPath;
32      }
33  
34      @Override
35      public String toString() {
36          StringBuilder sb = new StringBuilder();
37          sb.append("author: ");
38          sb.append(author);
39          sb.append("\ndescription: ");
40          sb.append(description);
41          sb.append("\nclientPackagePath: ");
42          sb.append(clientPackagePath);
43          sb.append("\nserverPackagePath: ");
44          sb.append(serverPackagePath);
45          sb.append("\nremote: ");
46          sb.append(isRemote);
47          return sb.toString();
48      }
49  
50      @Override
51      public boolean equals(Object obj) {
52          if (obj instanceof PluginDescriptor) {
53              PluginDescriptor descriptor = (PluginDescriptor) obj;
54              return this.author.equals(descriptor.author)
55                      &&this.clientPackagePath.equals(descriptor.clientPackagePath)
56                      &&this.serverPackagePath.equals(descriptor.serverPackagePath)
57                      &&this.serverBuilderPackagePath.equals(descriptor.serverBuilderPackagePath)
58                      &&(this.isRemote == descriptor.isRemote);
59          }
60          return false;
61      }
62      
63      @Override
64      public int hashCode() {
65          return clientPackagePath.hashCode()*serverPackagePath.hashCode()*serverBuilderPackagePath.hashCode();
66      }
67      
68  }