List of usage examples for java.util LinkedHashMap get
public V get(Object key)
From source file:org.raxa.module.raxacore.web.v1_0.controller.DrugInventoryControllerTest.java
/** * @see RaxaAlertController#searchByProviderRecipient(String, HttpServeletRequest, HttpServletResponse) * @throws Exception//w w w . j a va2 s .co m */ @Test public void searchByLocation_shouldGetInventoriesByLocation() throws Exception { String results = controller.searchByLocation("dc5c1fcc-0459-4201-bf70-0b90535ba362", request); LinkedHashMap di = (LinkedHashMap) ((ArrayList) SimpleObject.parseJson(results).get("results")).get(0); Assert.assertEquals("Test drug inventory", di.get("name")); }
From source file:org.raxa.module.raxacore.web.v1_0.controller.DrugPurchaseOrderControllerTest.java
/** * @see DrugPurchaseOrderController#searchByStockLocation(String, HttpServeletRequest, HttpServletResponse) * @throws Exception//from w ww .j a v a 2 s.c om */ @Test public void searchByStockLocation_shouldGetPurchaseOrdersByStockLocation() throws Exception { String results = controller.searchByStockLocation("9356400c-a5a2-4532-8f2b-2361b3446eb8", request); LinkedHashMap di = (LinkedHashMap) ((ArrayList) SimpleObject.parseJson(results).get("results")).get(0); Assert.assertEquals("Test drug PO", di.get("name")); }
From source file:adalid.core.XS1.java
private static Collection<Field> getRidOfDupFields(Collection<Field> fields) { LinkedHashMap<String, Field> map = new LinkedHashMap<>(); String key;//from ww w . j ava 2 s . c o m for (Field field : fields) { key = field.getName(); if (map.containsKey(key)) { TLC.getProject().getParser().error("Field " + key + " hides another field"); logger.error(TAB + "hiding field: " + field); logger.error(TAB + "hidden field: " + map.get(key)); } map.put(key, field); } return map.values(); }
From source file:au.org.ala.biocache.util.CollectionsCache.java
/** * Do the web services call. Uses RestTemplate. * * @param type/*from w ww. j a v a2 s.c om*/ * @return */ protected LinkedHashMap<String, String> getCodesMap(ResourceType type, List<String> guids) { LinkedHashMap<String, String> entityMap = null; logger.info("Updating code map with " + guids); try { // grab cached values (map) in case WS is not available (uses reflection) Field f = CollectionsCache.class.getDeclaredField(type.getType() + "s"); // field is plural form entityMap = (LinkedHashMap<String, String>) f.get(this); logger.debug("checking map size: " + entityMap.size()); } catch (Exception ex) { logger.error("Java reflection error: " + ex.getMessage(), ex); } try { entityMap = new LinkedHashMap<String, String>(); // reset now we're inside the try final String jsonUri = registryUrl + "/" + type.getType() + ".json"; logger.debug("Requesting: " + jsonUri); List<LinkedHashMap<String, String>> entities = restTemplate.getForObject(jsonUri, List.class); logger.debug("number of entities = " + entities.size()); for (LinkedHashMap<String, String> je : entities) { if (addToCodeMap(je.get("uid"), guids)) { entityMap.put(je.get("uid"), je.get("name")); } } } catch (Exception ex) { logger.error("RestTemplate error: " + ex.getMessage(), ex); } return entityMap; }
From source file:com.fortify.bugtracker.tgt.octane.processor.OctaneTargetProcessorSubmitIssues.java
@Override protected TargetIssueLocator submitIssue(Context context, LinkedHashMap<String, Object> issueData) { OctaneAuthenticatingRestConnection conn = OctaneConnectionFactory.getConnection(context); issueData.put("name", StringUtils.abbreviate((String) issueData.get("name"), 254)); return conn.submitIssue( new OctaneSharedSpaceAndWorkspaceId(ICLIOptionsOctane.CLI_OCTANE_SHARED_SPACE_UID.getValue(context), ICLIOptionsOctane.CLI_OCTANE_WORKSPACE_ID.getValue(context)), issueData);// w w w . jav a 2s . c om }
From source file:com.fortify.bugtracker.tgt.tfs.processor.TFSTargetProcessorSubmitIssues.java
@Override protected TargetIssueLocator submitIssue(Context context, LinkedHashMap<String, Object> issueData) { TFSRestConnection conn = TFSConnectionFactory.getConnection(context); issueData.put("System.Title", StringUtils.abbreviate((String) issueData.get("System.Title"), 254)); return conn.submitIssue(ICLIOptionsTFS.CLI_TFS_COLLECTION.getValue(context), ICLIOptionsTFS.CLI_TFS_PROJECT.getValue(context), getWorkItemType(), issueData); }
From source file:org.obiba.mica.core.service.SchemaFormContentFileService.java
private void saveFiles(Iterable files, String entityPath) { if (files != null) files.forEach(file -> {/*from w w w .j a v a 2 s . c om*/ LinkedHashMap map = (LinkedHashMap) file; map.put("path", entityPath); fileStoreService.save(map.get("id").toString()); }); }
From source file:de.roderick.weberknecht.WebSocketHandshake.java
private String generateHeader(LinkedHashMap<String, String> headers) { String header = new String(); for (String fieldName : headers.keySet()) { header += fieldName + ": " + headers.get(fieldName) + "\r\n"; }// w w w.j ava 2s . co m return header; }
From source file:com.opengamma.analytics.financial.interestrate.SABRTermStructureParameters.java
public SABRTermStructureParameters(final LinkedHashMap<String, Curve<Double, Double>> curveBundle) { Validate.notNull(curveBundle, "null curve bundle"); Curve<Double, Double> alpha = curveBundle.get(ALPHA); Curve<Double, Double> beta = curveBundle.get(BETA); Curve<Double, Double> nu = curveBundle.get(NU); Curve<Double, Double> rho = curveBundle.get(RHO); validate(alpha, beta, rho, nu);/*w w w. ja v a 2 s . c o m*/ _alpha = alpha; _beta = beta; _nu = nu; _rho = rho; _sabrFunction = DEFUALT_SABR; }
From source file:org.raxa.module.raxacore.web.v1_0.controller.RaxaAlertControllerTest.java
@Test public void searchByToLocation_shouldGetAlertsByLocation() throws Exception { String results = controller.searchByToLocation("9356400c-a5a2-4532-8f2b-2361b3446eb8", request); LinkedHashMap raxaAlert = (LinkedHashMap) ((ArrayList) SimpleObject.parseJson(results).get("results")) .get(0);/*from ww w.jav a2 s . c o m*/ Assert.assertEquals("TestAlert2", raxaAlert.get("name")); }