List of usage examples for java.util LinkedHashMap LinkedHashMap
public LinkedHashMap()
From source file:com.wavemaker.tools.apidocs.tools.parser.util.MethodUtils.java
public static Map<String, Method> getMethodUniqueIdentifierIdMap(Class<?> type) { Map<String, Method> identifierMap = new LinkedHashMap<>(); for (Method method : type.getDeclaredMethods()) { identifierMap.put(getMethodUniqueIdentifierId(method), method); }//from ww w. j a va 2s . c om return identifierMap; }
From source file:com.opengamma.analytics.financial.provider.curve.CurveBuildingBlockBundle.java
/** * Constructor from a map. A new map is created. * @param bundle A map of curve names to curve building units and Jacobian. *///from w ww . j ava 2 s .c o m public CurveBuildingBlockBundle(final LinkedHashMap<String, Pair<CurveBuildingBlock, DoubleMatrix2D>> bundle) { _bundle = new LinkedHashMap<>(); _bundle.putAll(bundle); }
From source file:act.reports.controller.AllInvoicesControllerHelper.java
public List<Map<String, String>> convertInvoicesListAsExcelFormat(ExportInvoicesList invoicesList) { List<Map<String, String>> excelDetails = new ArrayList<Map<String, String>>(); try {/*from w w w . j a v a2s. c o m*/ for (int i = 0; i < invoicesList.getRecCount(); i++) { Map<String, String> excelExpireData = new LinkedHashMap<String, String>(); if (invoicesList.getServiceCallDate() != null && i < invoicesList.getServiceCallDate().size()) excelExpireData.put("serviceCallDate", invoicesList.getServiceCallDate().get(i)); if (invoicesList.getInvoice() != null && i < invoicesList.getInvoice().size()) excelExpireData.put("invoice", invoicesList.getInvoice().get(i)); if (invoicesList.getRequestedBy() != null && i < invoicesList.getRequestedBy().size()) excelExpireData.put("requestedBy", invoicesList.getRequestedBy().get(i)); if (invoicesList.getSalesRep() != null && i < invoicesList.getSalesRep().size()) excelExpireData.put("salesRep", invoicesList.getSalesRep().get(i)); if (invoicesList.getRatePlan() != null && i < invoicesList.getRatePlan().size()) excelExpireData.put("ratePlan", invoicesList.getRatePlan().get(i)); if (invoicesList.getPriority() != null && i < invoicesList.getPriority().size()) excelExpireData.put("priority", invoicesList.getPriority().get(i)); if (invoicesList.getReason() != null && i < invoicesList.getReason().size()) excelExpireData.put("reason", invoicesList.getReason().get(i)); /*if(invoicesList.getPriorityAndReason()!=null && i<invoicesList.getPriorityAndReason().size()) excelExpireData.put("priorityAndReason", invoicesList.getPriorityAndReason().get(i));*/ if (invoicesList.getTowType() != null && i < invoicesList.getTowType().size()) excelExpireData.put("towType", invoicesList.getTowType().get(i)); if (invoicesList.getOrDr() != null && i < invoicesList.getOrDr().size()) excelExpireData.put("orDr", invoicesList.getOrDr().get(i)); if (invoicesList.getDriverLicense() != null && i < invoicesList.getDriverLicense().size()) excelExpireData.put("driverLicense", invoicesList.getDriverLicense().get(i)); if (invoicesList.getDriverIsOwner() != null && i < invoicesList.getDriverIsOwner().size()) excelExpireData.put("driverIsOwner", invoicesList.getDriverIsOwner().get(i)); if (invoicesList.getNoOwnerInfo() != null && i < invoicesList.getNoOwnerInfo().size()) excelExpireData.put("noOwnerInfo", invoicesList.getNoOwnerInfo().get(i)); if (invoicesList.getRegisteredOwner() != null && i < invoicesList.getRegisteredOwner().size()) excelExpireData.put("registeredOwner", invoicesList.getRegisteredOwner().get(i)); if (invoicesList.getRegisteredOwnerName() != null && i < invoicesList.getRegisteredOwnerName().size()) excelExpireData.put("registeredOwnerName", invoicesList.getRegisteredOwnerName().get(i)); if (invoicesList.getRegisteredOwnerAddress() != null && i < invoicesList.getRegisteredOwnerAddress().size()) excelExpireData.put("registeredOwnerAddress", invoicesList.getRegisteredOwnerAddress().get(i)); if (invoicesList.getRegisteredOwnerCity() != null && i < invoicesList.getRegisteredOwnerCity().size()) excelExpireData.put("registeredOwnerCity", invoicesList.getRegisteredOwnerCity().get(i)); if (invoicesList.getRegisteredOwnerState() != null && i < invoicesList.getRegisteredOwnerState().size()) excelExpireData.put("registeredOwnerState", invoicesList.getRegisteredOwnerState().get(i)); if (invoicesList.getRegisteredOwnerZip() != null && i < invoicesList.getRegisteredOwnerZip().size()) excelExpireData.put("registeredOwnerZip", invoicesList.getRegisteredOwnerZip().get(i)); if (invoicesList.getRegisteredOwnerPhone() != null && i < invoicesList.getRegisteredOwnerPhone().size()) excelExpireData.put("registeredOwnerPhone", invoicesList.getRegisteredOwnerPhone().get(i)); if (invoicesList.getRegisteredOwnerEmail() != null && i < invoicesList.getRegisteredOwnerEmail().size()) excelExpireData.put("registeredOwnerEmail", invoicesList.getRegisteredOwnerEmail().get(i)); if (invoicesList.getYear() != null && i < invoicesList.getYear().size()) excelExpireData.put("year", invoicesList.getYear().get(i)); if (invoicesList.getMake() != null && i < invoicesList.getMake().size()) excelExpireData.put("make", invoicesList.getMake().get(i)); if (invoicesList.getModel() != null && i < invoicesList.getModel().size()) excelExpireData.put("model", invoicesList.getModel().get(i)); if (invoicesList.getColor() != null && i < invoicesList.getColor().size()) excelExpireData.put("color", invoicesList.getColor().get(i)); if (invoicesList.getStyle() != null && i < invoicesList.getStyle().size()) excelExpireData.put("style", invoicesList.getStyle().get(i)); if (invoicesList.getVin() != null && i < invoicesList.getVin().size()) excelExpireData.put("vin", invoicesList.getVin().get(i)); if (invoicesList.getPlateCountry() != null && i < invoicesList.getPlateCountry().size()) excelExpireData.put("plateCountry", invoicesList.getPlateCountry().get(i)); if (invoicesList.getPlateState() != null && i < invoicesList.getPlateState().size()) excelExpireData.put("plateState", invoicesList.getPlateState().get(i)); if (invoicesList.getPlate() != null && i < invoicesList.getPlate().size()) excelExpireData.put("plate", invoicesList.getPlate().get(i)); if (invoicesList.getKeys() != null && i < invoicesList.getKeys().size()) excelExpireData.put("keys", invoicesList.getKeys().get(i)); if (invoicesList.getRadio() != null && i < invoicesList.getRadio().size()) excelExpireData.put("radio", invoicesList.getRadio().get(i)); if (invoicesList.getVehicleStatus() != null && i < invoicesList.getVehicleStatus().size()) excelExpireData.put("vehicleStatus", invoicesList.getVehicleStatus().get(i)); if (invoicesList.getCommercialUnit() != null && i < invoicesList.getCommercialUnit().size()) excelExpireData.put("commercialUnit", invoicesList.getCommercialUnit().get(i)); if (invoicesList.getPoliceImpound() != null && i < invoicesList.getPoliceImpound().size()) excelExpireData.put("policeImpound", invoicesList.getPoliceImpound().get(i)); if (invoicesList.getCallTime() != null && i < invoicesList.getCallTime().size()) excelExpireData.put("callTime", invoicesList.getCallTime().get(i)); if (invoicesList.getDispatchTime() != null && i < invoicesList.getDispatchTime().size()) excelExpireData.put("dispatchTime", invoicesList.getDispatchTime().get(i)); if (invoicesList.getAcceptedTime() != null && i < invoicesList.getAcceptedTime().size()) excelExpireData.put("acceptedTime", invoicesList.getAcceptedTime().get(i)); if (invoicesList.getEnrouteTime() != null && i < invoicesList.getEnrouteTime().size()) excelExpireData.put("enrouteTime", invoicesList.getEnrouteTime().get(i)); if (invoicesList.getArrivedTime() != null && i < invoicesList.getArrivedTime().size()) excelExpireData.put("arrivedTime", invoicesList.getArrivedTime().get(i)); if (invoicesList.getHookedTime() != null && i < invoicesList.getHookedTime().size()) excelExpireData.put("hookedTime", invoicesList.getHookedTime().get(i)); if (invoicesList.getDroppedTime() != null && i < invoicesList.getDroppedTime().size()) excelExpireData.put("droppedTime", invoicesList.getDroppedTime().get(i)); if (invoicesList.getClearTime() != null && i < invoicesList.getClearTime().size()) excelExpireData.put("clearTime", invoicesList.getClearTime().get(i)); if (invoicesList.getTotalTime() != null && i < invoicesList.getTotalTime().size()) excelExpireData.put("totalTime", invoicesList.getTotalTime().get(i)); if (invoicesList.getPickupLocation() != null && i < invoicesList.getPickupLocation().size()) excelExpireData.put("pickupLocation", invoicesList.getPickupLocation().get(i)); if (invoicesList.getPickupAddress() != null && i < invoicesList.getPickupAddress().size()) excelExpireData.put("pickupAddress", invoicesList.getPickupAddress().get(i)); if (invoicesList.getPickupCity() != null && i < invoicesList.getPickupCity().size()) excelExpireData.put("pickupCity", invoicesList.getPickupCity().get(i)); if (invoicesList.getPickupState() != null && i < invoicesList.getPickupState().size()) excelExpireData.put("pickupState", invoicesList.getPickupState().get(i)); if (invoicesList.getPickupZipcode() != null && i < invoicesList.getPickupZipcode().size()) excelExpireData.put("pickupZipcode", invoicesList.getPickupZipcode().get(i)); if (invoicesList.getDropOffLocation() != null && i < invoicesList.getDropOffLocation().size()) excelExpireData.put("dropOffLocation", invoicesList.getDropOffLocation().get(i)); if (invoicesList.getDropOffAddress() != null && i < invoicesList.getDropOffAddress().size()) excelExpireData.put("dropOffAddress", invoicesList.getDropOffAddress().get(i)); if (invoicesList.getDropOffCity() != null && i < invoicesList.getDropOffCity().size()) excelExpireData.put("dropOffCity", invoicesList.getDropOffCity().get(i)); if (invoicesList.getDropOffState() != null && i < invoicesList.getDropOffState().size()) excelExpireData.put("dropOffState", invoicesList.getDropOffState().get(i)); if (invoicesList.getDropOffZipcode() != null && i < invoicesList.getDropOffZipcode().size()) excelExpireData.put("dropOffZipcode", invoicesList.getDropOffZipcode().get(i)); if (invoicesList.getTruck() != null && i < invoicesList.getTruck().size()) excelExpireData.put("truck", invoicesList.getTruck().get(i)); if (invoicesList.getDriverId() != null && i < invoicesList.getDriverId().size()) excelExpireData.put("driverId", invoicesList.getDriverId().get(i)); if (invoicesList.getDispatchId() != null && i < invoicesList.getDispatchId().size()) excelExpireData.put("dispatchId", invoicesList.getDispatchId().get(i)); if (invoicesList.getCallReceiverId() != null && i < invoicesList.getCallReceiverId().size()) excelExpireData.put("callReceiverId", invoicesList.getCallReceiverId().get(i)); if (invoicesList.getTowCharge() != null && i < invoicesList.getTowCharge().size()) excelExpireData.put("towCharge", invoicesList.getTowCharge().get(i)); if (invoicesList.getStorageCharge() != null && i < invoicesList.getStorageCharge().size()) excelExpireData.put("storageCharge", invoicesList.getStorageCharge().get(i)); if (invoicesList.getLaborCharge() != null && i < invoicesList.getLaborCharge().size()) excelExpireData.put("laborCharge", invoicesList.getLaborCharge().get(i)); if (invoicesList.getMileageCharge() != null && i < invoicesList.getMileageCharge().size()) excelExpireData.put("mileageCharge", invoicesList.getMileageCharge().get(i)); if (invoicesList.getWinchCharge() != null && i < invoicesList.getWinchCharge().size()) excelExpireData.put("winchCharge", invoicesList.getWinchCharge().get(i)); if (invoicesList.getGateCharge() != null && i < invoicesList.getGateCharge().size()) excelExpireData.put("gateCharge", invoicesList.getGateCharge().get(i)); if (invoicesList.getAdminCharge() != null && i < invoicesList.getAdminCharge().size()) excelExpireData.put("adminCharge", invoicesList.getAdminCharge().get(i)); if (invoicesList.getMiscChargeDesc() != null && i < invoicesList.getMiscChargeDesc().size()) excelExpireData.put("miscChargeDesc", invoicesList.getMiscChargeDesc().get(i)); if (invoicesList.getMiscCharge() != null && i < invoicesList.getMiscCharge().size()) excelExpireData.put("miscCharge", invoicesList.getMiscCharge().get(i)); if (invoicesList.getDiscounts() != null && i < invoicesList.getDiscounts().size()) excelExpireData.put("discounts", invoicesList.getDiscounts().get(i)); if (invoicesList.getTotalCharges() != null && i < invoicesList.getTotalCharges().size()) excelExpireData.put("totalCharges", invoicesList.getTotalCharges().get(i)); if (invoicesList.getAmountPaid() != null && i < invoicesList.getAmountPaid().size()) excelExpireData.put("amountPaid", invoicesList.getAmountPaid().get(i)); if (invoicesList.getInStorage() != null && i < invoicesList.getInStorage().size()) excelExpireData.put("inStorage", invoicesList.getInStorage().get(i)); if (invoicesList.getBillTo() != null && i < invoicesList.getBillTo().size()) excelExpireData.put("billTo", invoicesList.getBillTo().get(i)); if (invoicesList.getReleasedTo() != null && i < invoicesList.getReleasedTo().size()) excelExpireData.put("releasedTo", invoicesList.getReleasedTo().get(i)); if (invoicesList.getReleaseTime() != null && i < invoicesList.getReleaseTime().size()) excelExpireData.put("releaseTime", invoicesList.getReleaseTime().get(i)); if (invoicesList.getReleaseDate() != null && i < invoicesList.getReleaseDate().size()) excelExpireData.put("releaseDate", invoicesList.getReleaseDate().get(i)); if (invoicesList.getAvrFiledDate() != null && i < invoicesList.getAvrFiledDate().size()) excelExpireData.put("avrFiledDate", invoicesList.getAvrFiledDate().get(i)); if (invoicesList.getTrnsfrOfAuth() != null && i < invoicesList.getTrnsfrOfAuth().size()) excelExpireData.put("trnsfrOfAuth", invoicesList.getTrnsfrOfAuth().get(i)); if (invoicesList.getTitleDate() != null && i < invoicesList.getTitleDate().size()) excelExpireData.put("titleDate", invoicesList.getTitleDate().get(i)); if (invoicesList.getLocked() != null && i < invoicesList.getLocked().size()) excelExpireData.put("locked", invoicesList.getLocked().get(i)); if (invoicesList.getClosed() != null && i < invoicesList.getClosed().size()) excelExpireData.put("closed", invoicesList.getClosed().get(i)); excelDetails.add(excelExpireData); } } catch (Exception e) { logger.error(e); e.printStackTrace(); } return excelDetails; }
From source file:cherry.sqlman.tool.shared.ParamParserImpl.java
@Override public Map<String, ?> parseMap(String pmap) { if (StringUtils.isBlank(pmap)) { return new LinkedHashMap<>(); }// ww w . ja v a 2s. c om try { JavaType type = TypeFactory.defaultInstance().constructMapType(LinkedHashMap.class, String.class, Object.class); return objectMapper.readValue(pmap, type); } catch (IOException ex) { return new LinkedHashMap<>(); } }
From source file:controllers.CarPropertyController.java
@ModelAttribute public void setInfo(Map<String, Object> model) { Map<String, Object> res = new LinkedHashMap(); res.put(null, "?"); for (CarPropertyGroup cpg : carPropertyGroupService.getGroups(null)) { res.put(StringAdapter.getString(cpg.getId()), cpg.getTitle()); }/* w w w. j a v a 2s . co m*/ model.put("groupDict", res); }
From source file:com.streamsets.pipeline.lib.jdbc.JdbcMetastoreUtil.java
public static LinkedHashMap<String, JdbcTypeInfo> convertRecordToJdbcType(Record record, String precisionAttribute, String scaleAttribute, JdbcSchemaWriter schemaWriter) throws OnRecordErrorException, JdbcStageCheckedException { if (!record.get().getType().isOneOf(Field.Type.MAP, Field.Type.LIST_MAP)) { throw new OnRecordErrorException(record, JdbcErrors.JDBC_300, record.getHeader().getSourceId(), record.get().getType().toString()); }//from w ww . j av a 2s. com LinkedHashMap<String, JdbcTypeInfo> columns = new LinkedHashMap<>(); Map<String, Field> list = record.get().getValueAsMap(); for (Map.Entry<String, Field> pair : list.entrySet()) { if (StringUtils.isEmpty(pair.getKey())) { throw new OnRecordErrorException(record, JdbcErrors.JDBC_301, "Field name is empty"); } String fieldPath = pair.getKey(); Field currField = pair.getValue(); // Some types requires special checks or alterations JdbcType jdbcType = JdbcType.getJdbcTypeforFieldType(currField.getType()); JdbcTypeInfo jdbcTypeInfo; if (jdbcType == JdbcType.DECIMAL) { int precision = resolveScaleOrPrecisionExpression("precision", currField, precisionAttribute, fieldPath); int scale = resolveScaleOrPrecisionExpression("scale", currField, scaleAttribute, fieldPath); schemaWriter.validateScaleAndPrecision(pair.getKey(), currField, precision, scale); jdbcTypeInfo = jdbcType.getSupport().generateJdbcTypeInfoFromRecordField(currField, schemaWriter, precision, scale); } else { jdbcTypeInfo = jdbcType.getSupport().generateJdbcTypeInfoFromRecordField(currField, schemaWriter); } columns.put(pair.getKey().toLowerCase(), jdbcTypeInfo); } return columns; }
From source file:com.rodiontsev.maven.plugins.buildinfo.providers.BuildTimeProvider.java
@Override public Map<String, String> getInfo(MavenProject project, BuildInfoMojo mojo) { Map<String, String> info = new LinkedHashMap<String, String>(); String dateTimePattern = mojo.getDateTimePattern(); if (StringUtils.isNotBlank(dateTimePattern)) { String buildTime;/*from w w w .j a v a 2 s. co m*/ try { DateFormat dateFormat = new SimpleDateFormat(dateTimePattern, Locale.ENGLISH); buildTime = dateFormat.format(new Date()); } catch (IllegalArgumentException e) { buildTime = "the given pattern is invalid"; mojo.getLog().warn(String.format( "The given date-time pattern '%s' is invalid. Please read %s javadoc about user-defined patterns for date-time formatting.", dateTimePattern, SimpleDateFormat.class.getCanonicalName())); } info.put("build.time", buildTime); } return info; }
From source file:org.openmrs.module.htmlformentry.DrugCompatibility2_0.java
@Override public List<Map<String, Object>> simplify(List<Drug> drugs) { List<Map<String, Object>> simplified = new ArrayList<Map<String, Object>>(); Locale locale = Context.getLocale(); for (Drug drug : drugs) { Map<String, Object> item = new LinkedHashMap<String, Object>(); item.put("id", drug.getId()); item.put("name", drug.getName()); if (drug.getDosageForm() != null) { item.put("dosageForm", drug.getDosageForm().getName(locale).getName()); }/* ww w .j a va 2s. c o m*/ item.put("combination", drug.getCombination()); if (drug.getConcept() != null) { item.put("concept", drug.getConcept().getName(locale).getName()); } simplified.add(item); } return simplified; }
From source file:edu.eci.cosw.postresYa.stub.StubActividad.java
/** * El constructor del StubPostre instancia un nuevo objeto postre * y los almacena en memoria//from www . j a va 2 s.co m * @throws PostreException */ public StubActividad() throws PostreException { postres = new LinkedHashSet<>(); postresMap = new LinkedHashMap<>(); postresImages = new LinkedHashMap<>(); Actividad prueba = new Actividad("vocales", "se deben ensear las vocales con las que sean mas facil de escribir, en el siguiente orden i u e o a"); postres.add(prueba); postresMap.put(prueba.getName(), prueba); postresImages.put(prueba.getName(), "src/main/resources/static/app/images/Postre1.png"); }
From source file:com.mulodo.survey.batch.writer.TestMailSender.java
@Override public void send(SimpleMailMessage[] simpleMessages) throws MailException { Map<Object, Exception> failedMessages = new LinkedHashMap<Object, Exception>(); for (SimpleMailMessage simpleMessage : simpleMessages) { try {//from w w w . ja va 2 s.c o m this.mailSender.send(simpleMessage); } catch (MailException ex) { throw new MailSendException(failedMessages); } } }