List of usage examples for java.util LinkedHashMap put
V put(K key, V value);
From source file:com.nextdoor.bender.handler.s3.S3InternalEvent.java
@Override public LinkedHashMap<String, String> getPartitions() { LinkedHashMap<String, String> partitions = super.getPartitions(); if (partitions == null) { partitions = new LinkedHashMap<String, String>(1); super.setPartitions(partitions); }/*from w w w.j av a 2 s .c om*/ partitions.put(FILENAME_PARTITION, DigestUtils.sha1Hex(this.s3Key)); return partitions; }
From source file:com.github.nmorel.gwtjackson.shared.advanced.jsontype.TypeNamesTester.java
public void testRoundTripMap(ObjectMapperTester<LinkedHashMap<String, Animal>> mapper) { LinkedHashMap<String, Animal> input = new LinkedHashMap<String, Animal>(); input.put("venla", new MaineCoon("Venla", true)); input.put("ama", new Dog("Amadeus", 13)); String json = mapper.write(input); assertEquals("{\"venla\":{\"TypeNamesTester$MaineCoon\":{\"name\":\"Venla\",\"purrs\":true}}," + "" + "\"ama\":{\"doggy\":{\"ageInYears\":13,\"name\":\"Amadeus\"}}}", json); LinkedHashMap<String, Animal> output = mapper.read(json); assertNotNull(output);//from w w w .j a v a 2 s . c om assertEquals(input.size(), output.size()); // for some reason, straight comparison won't work... for (String name : input.keySet()) { Animal in = input.get(name); Animal out = output.get(name); if (!in.equals(out)) { fail("Animal in input was [" + in + "]; output not matching: [" + out + "]"); } } }
From source file:com.fortify.processrunner.octane.processor.ProcessorOctaneSubmitIssueForVulnerabilities.java
@Override protected SubmittedIssue submitIssue(Context context, LinkedHashMap<String, Object> issueData) { IContextOctane contextOctane = context.as(IContextOctane.class); OctaneAuthenticatingRestConnection conn = OctaneConnectionFactory.getConnection(context); issueData.put("name", StringUtils.abbreviate((String) issueData.get("name"), 254)); return conn.submitIssue(new OctaneSharedSpaceAndWorkspaceId(contextOctane.getOctaneSharedSpaceUid(), contextOctane.getOctaneWorkspaceId()), issueData); }
From source file:javaslang.jackson.datatype.serialize.MultimapSerializer.java
@Override Object toJavaObj(Multimap<?, ?> value) throws IOException { final LinkedHashMap<Object, List<Object>> result = new LinkedHashMap<>(); value.forEach(e -> {/*from w ww.j av a2 s. c om*/ List<Object> list = result.get(e._1); if (list == null) { list = new ArrayList<>(); result.put(e._1, list); } list.add(e._2); }); return result; }
From source file:it.units.malelab.ege.core.listener.PropertiesListener.java
@Override public Map<String, String> getFormattedNames() { LinkedHashMap<String, String> formattedNames = new LinkedHashMap<>(); formattedNames.put("properties.mapping.invalidity", "%4.2f"); formattedNames.put("properties.mapping.count", "%4d"); for (String operatorName : operatorNames.values()) { formattedNames.put("properties.operator." + operatorName + ".redundancy", "%4.2f"); formattedNames.put("properties.operator." + operatorName + ".locality", "%+4.2f"); formattedNames.put("properties.operator." + operatorName + ".locality.cumulative", "%+4.2f"); formattedNames.put("properties.operator." + operatorName + ".evolvability", "%4.2f"); formattedNames.put("properties.operator." + operatorName + ".count", "%4d"); formattedNames.put("properties.operator." + operatorName + ".count.valid", "%4d"); }//from www.j a va 2 s. co m return formattedNames; }
From source file:com.fortify.processrunner.tfs.processor.ProcessorTFSSubmitIssueForVulnerabilities.java
@Override protected SubmittedIssue submitIssue(Context context, LinkedHashMap<String, Object> issueData) { IContextTFS contextTFS = context.as(IContextTFS.class); TFSRestConnection conn = TFSConnectionFactory.getConnection(context); issueData.put("System.Title", StringUtils.abbreviate((String) issueData.get("System.Title"), 254)); String workItemType = getWorkItemType(contextTFS); fieldRenamer.renameFields(workItemType, issueData); return conn.submitIssue(contextTFS.getTFSCollection(), contextTFS.getTFSProject(), workItemType, issueData); }
From source file:edu.cornell.kfs.coa.businessobject.AccountReversionGlobalAccount.java
/** * @see org.kuali.kfs.kns.bo.BusinessObjectBase#toStringMapper() *///from w ww .j a va 2 s . c o m protected LinkedHashMap toStringMapperr_RICE20_REFACTORME() { LinkedHashMap stringMapper = new LinkedHashMap(); stringMapper.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); stringMapper.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.chartOfAccountsCode); stringMapper.put(KFSPropertyConstants.ACCOUNT_NUMBER, this.accountNumber); return stringMapper; }
From source file:it.units.malelab.ege.core.listener.PropertiesListener.java
@Override public Map<String, Object> collect(GenerationEvent<G, T, F> generationEvent) { //compute aggregates LinkedHashMap<String, Object> values = new LinkedHashMap<>(); values.put("properties.mapping.invalidity", (double) counts.get(NO_OPERATOR).count(CountType.INVALID) / (double) counts.get(NO_OPERATOR).count(CountType.MAPPING)); values.put("properties.mapping.count", counts.get(NO_OPERATOR).count(CountType.MAPPING)); for (String operatorName : operatorNames.values()) { values.put("properties.operator." + operatorName + ".redundancy", (double) counts.get(operatorName).count(CountType.REDUNDANT) / (double) counts.get(operatorName).count(CountType.VALID_OPERATOR_APPLICATION)); values.put("properties.operator." + operatorName + ".locality", Utils.pearsonCorrelation(partialDistances.get(operatorName))); values.put("properties.operator." + operatorName + ".locality.cumulative", Utils.pearsonCorrelation(cumulativeDistances.get(operatorName))); values.put("properties.operator." + operatorName + ".evolvability", (double) counts.get(operatorName).count(CountType.BETTER_FITNESS) / (double) counts.get(operatorName).count(CountType.OPERATOR_APPLICATION)); values.put("properties.operator." + operatorName + ".count", counts.get(operatorName).count(CountType.OPERATOR_APPLICATION)); values.put("properties.operator." + operatorName + ".count.valid", counts.get(operatorName).count(CountType.VALID_OPERATOR_APPLICATION)); }// w w w. j a va 2 s . co m return values; }
From source file:org.lightadmin.core.config.context.LightAdminSecurityConfiguration.java
private FilterInvocationSecurityMetadataSource securityMetadataSource() { LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> map = newLinkedHashMap(); map.put(AnyRequestMatcher.INSTANCE, asList((ConfigAttribute) new SecurityConfig(ROLE_ADMIN))); return new DefaultFilterInvocationSecurityMetadataSource(map); }
From source file:com.opengamma.analytics.financial.provider.sensitivity.multicurve.SimpleParameterSensitivity.java
/** * Create a copy of the object with all the sensitivities multiplied by a common factor. * @param factor The factor./*from ww w. ja v a2 s .c o m*/ * @return The multiplied sensitivity. */ public SimpleParameterSensitivity multipliedBy(final double factor) { final MatrixAlgebra algebra = MatrixAlgebraFactory.COMMONS_ALGEBRA; final LinkedHashMap<String, DoubleMatrix1D> result = new LinkedHashMap<>(); for (final String nameCcy : _sensitivity.keySet()) { result.put(nameCcy, (DoubleMatrix1D) algebra.scale(_sensitivity.get(nameCcy), factor)); } return new SimpleParameterSensitivity(result); }