View Javadoc
1   package org.kuali.ole.docstore.indexer.solr;
2   
3   /**
4    * Created with IntelliJ IDEA.
5    * User: jayabharathreddy
6    * Date: 7/24/13
7    * Time: 4:06 PM
8    * To change this template use File | Settings | File Templates.
9    */
10  public class DocumentLocalId {
11  
12      public static int getDocumentId(String uuid) {
13          if (hasPrefix(uuid)) {
14              String[] prefixes = uuid.split("-");
15              return Integer.valueOf(prefixes[1]).intValue();
16          }
17          return Integer.valueOf(uuid).intValue();
18      }
19  
20      public static boolean hasPrefix(String uuid) {
21          String[] prefixes = uuid.split("-");
22          if (prefixes.length == 2) {
23              return true;
24          }
25          return false;
26      }
27  
28      public static String getDocumentIdDisplay(String uuid) {
29          if (hasPrefix(uuid)) {
30              String[] prefixes = uuid.split("-");
31              return prefixes[1];
32          }
33          return uuid;
34      }
35  
36  
37  }