Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.54 KB | None | 0 0
  1. package uk.gov.rrs.helper;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import com.google.common.collect.ArrayListMultimap;
  7. import com.google.common.collect.Multimap;
  8.  
  9. public class MultimapHelper {
  10.  
  11.     private static MultimapHelper multimapHelper = null;
  12.     private static Multimap<String, String> caseworkingMultiMap;
  13.     private static Multimap<String, String> allocationsMultiMap;
  14.     private List<String> successCase;
  15.    
  16.     public static MultimapHelper getInstance() {
  17.         if (multimapHelper == null)
  18.             multimapHelper = new MultimapHelper();
  19.  
  20.         return multimapHelper;
  21.     }
  22.  
  23.     public MultimapHelper() {
  24.         caseworkingMultiMap = ArrayListMultimap.create();
  25.         allocationsMultiMap = ArrayListMultimap.create();
  26.         successCase = new ArrayList<String>();
  27.     }
  28.    
  29.     public void addSuccessCases(String caseNo) {
  30.         successCase.add(caseNo);
  31.     }
  32.    
  33.     public List<String> getSuccessCasesList(){
  34.         return successCase;
  35.     }
  36.    
  37.     public Multimap<String, String> getCaseworkMap() {
  38.         return caseworkingMultiMap;
  39.     }
  40.    
  41.     public Multimap<String, String> getAllocationsMap() {
  42.         return allocationsMultiMap;
  43.     }
  44.  
  45.     public void addKeyValueToCaseworkingMultiMap(String key, String value) {
  46.         caseworkingMultiMap.put(key, value);
  47.     }
  48.  
  49.     public String getCaseworkingMapValue(String key) {
  50.         return caseworkingMultiMap.get(key).toString();
  51.     }
  52.  
  53.     public String getAllocationsMapValue(String key) {
  54.         return allocationsMultiMap.get(key).toString();
  55.     }
  56.  
  57.     public void addKeyValueToAllocationsMultiMap(String key, String value) {
  58.         allocationsMultiMap.put(key, value);
  59.     }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement