View Javadoc

1   /*
2    * Created by IntelliJ IDEA.
3    * User: Mike
4    * Date: Jul 29, 2004
5    * Time: 3:19:33 PM
6    */
7   package com.atlassian.plugin;
8   
9   public class ModuleCompleteKey
10  {
11      private String pluginKey;
12      private String moduleKey;
13  
14      public ModuleCompleteKey(String completeKey)
15      {
16          if (completeKey == null)
17              throw new IllegalArgumentException("Invalid complete key specified: " + completeKey);
18              
19          final int sepIdx = completeKey.indexOf(":");
20  
21          if (sepIdx <= 0 || (sepIdx == completeKey.length() - 1))
22              throw new IllegalArgumentException("Invalid complete key specified: " + completeKey);
23  
24          pluginKey = completeKey.substring(0, sepIdx);
25          moduleKey = completeKey.substring(sepIdx + 1);
26      }
27  
28      public String getModuleKey()
29      {
30          return moduleKey;
31      }
32  
33      public String getPluginKey()
34      {
35          return pluginKey;
36      }
37  
38      public String getCompleteKey()
39      {
40          return pluginKey + ":" + moduleKey;
41      }
42  }