List of usage examples for java.util Collections EMPTY_MAP
Map EMPTY_MAP
To view the source code for java.util Collections EMPTY_MAP.
Click Source Link
From source file:com.espertech.esper.epl.core.eval.EvalSelectNoWildcardEmptyProps.java
public EventBean process(EventBean[] eventsPerStream, boolean isNewData, boolean isSynthesize, ExprEvaluatorContext exprEvaluatorContext) { return selectExprContext.getEventAdapterService().adapterForTypedMap(Collections.EMPTY_MAP, resultEventType);//from www . ja v a2 s .c om }
From source file:io.gumga.security.GumgaInstanceValuesProxy.java
@Transactional @ApiOperation(value = "List", notes = "Carrega entidade pela chave informada.") @RequestMapping(method = RequestMethod.GET) public Map load() { String software = GumgaThreadScope.softwareName.get(); String token = GumgaThreadScope.gumgaToken.get(); String url = getBaseUrl() + "/token/instance-values/" + software + "/" + token; Map response = getRestTemplate().getForObject(url, Map.class); if (response == null) { response = Collections.EMPTY_MAP; }//from w ww. j a va2s . c o m return response; }
From source file:org.dozer.spring.DozerBeanMapperFactoryBeanTest.java
@Test public void testOk() throws Exception { factory.setCustomConverters(Collections.EMPTY_LIST); factory.setCustomConvertersWithId(Collections.EMPTY_MAP); factory.setEventListeners(Collections.EMPTY_LIST); factory.setFactories(Collections.EMPTY_MAP); factory.setMappingFiles(new Resource[] { mockResource }); factory.setMappingBuilders(Collections.EMPTY_LIST); URL url = this.getClass().getClassLoader().getResource("mappingSpring.xml"); when(mockResource.getURL()).thenReturn(url); factory.afterPropertiesSet();// w ww . j av a 2 s . c o m assertEquals(Mapper.class, factory.getObjectType()); Assert.assertTrue(factory.isSingleton()); DozerBeanMapper mapper = (DozerBeanMapper) factory.getObject(); List<?> files = mapper.getMappingFiles(); assertEquals(1, files.size()); assertEquals("file:" + url.getFile(), files.iterator().next()); }
From source file:com.openteach.diamond.integrated.test.DemoTest.java
@Test public void test() throws Exception { // Provider/* w ww. ja v a 2 s . c om*/ ServiceMetadata metadata = new ServiceMetadata(); metadata.setName("test"); metadata.setInterfaceName(DemoService.class.getName()); metadata.setVersion("0.0.1"); metadata.exportProtocol(DefaultRPCProtocol4Server.PROTOCOL, Collections.EMPTY_MAP); ServiceProviderFactory factory = new DefaultServiceProviderFactory(); ServiceProvider provider = factory.newServiceProvider(metadata, new DemoServiceImpl()); DiamondServiceFactory.getDiamondService().register(metadata, provider.getMethodInvoker()); // Consumer ServiceMetadata cmetadata = new ServiceMetadata(); cmetadata.setName("test"); cmetadata.setInterfaceName(DemoService.class.getName()); cmetadata.setVersion("0.0.1"); cmetadata.addImportPortocol(DefaultRPCProtocol4Client.PROTOCOL, new Properties()); ServiceConsumerFactory cfactory = new DefaultServiceConsumerFactory(); ServiceConsumer consumer = cfactory.newServiceConsumer(cmetadata, DiamondServiceFactory.getDiamondService(), DiamondServiceFactory.getDiamondService()); DemoService service = (DemoService) consumer.getProxy(); String result = service.service("World"); if (!StringUtils.equals(result, "Hello World")) { throw new Exception("failed"); } System.out.println(result); for (int i = 0; i < 10000; i++) { System.out.println(service.service(String.format("%d", i))); } }
From source file:com.espertech.esper.epl.core.eval.EvalInsertNoWildcardSingleColCoercionBeanWrapVariant.java
public EventBean processFirstCol(Object result) { EventBean wrappedEvent = super.getEventAdapterService().adapterForBean(result); EventBean variant = vaeProcessor.getValueAddEventBean(wrappedEvent); return super.getEventAdapterService().adapterForTypedWrapper(variant, Collections.EMPTY_MAP, super.getResultEventType()); }
From source file:org.apache.cayenne.lifecycle.sort.WeightedAshwoodEntitySorter.java
public WeightedAshwoodEntitySorter() { this.weightedDbEntityComparator = new WeightedDbEntityComparator(); this.weightedObjEntityComparator = new WeightedObjEntityComparator(); this.entityWeights = Collections.EMPTY_MAP; }
From source file:fr.esiea.esieaddress.service.validation.implementation.ValidationService.java
@Override public Map<String, String> validate(T model) { Set<ConstraintViolation<T>> violations = validator.validate(model); if (violations.isEmpty()) return Collections.EMPTY_MAP; HashMap<String, String> errorMap = new HashMap<String, String>(); for (ConstraintViolation<T> violation : violations) { String[] propertyPath = violation.getPropertyPath().toString().split("\\."); errorMap.put(propertyPath[propertyPath.length - 1], violation.getMessage()); }/* w w w. j av a 2s . com*/ return errorMap; }
From source file:fr.esiea.windmeal.service.validation.implementation.ValidationService.java
@Override public Map<Object, String> validate(T model) { Set<ConstraintViolation<T>> violations = validator.validate(model); if (violations.isEmpty()) return Collections.EMPTY_MAP; HashMap<Object, String> errorMap = new HashMap<Object, String>(); for (ConstraintViolation<T> violation : violations) { String[] propertyPath = violation.getPropertyPath().toString().split("\\."); errorMap.put(propertyPath[propertyPath.length - 1], violation.getMessage()); }//from w ww.j av a 2s . co m return errorMap; }
From source file:com.epam.cme.core.services.impl.DefaultCompatibilityServiceIntegrationTest.java
@Before public void setUp() throws Exception { new CoreBasicDataCreator().createEssentialData(Collections.EMPTY_MAP, null); importCsv("/test/impex/test_feature-compatibility.impex", "utf-8"); LOG.info("Finsihed data setup"); }
From source file:net.lariverosc.jesquespring.SpringWorker.java
/** * * @param config used to create a connection to Redis * @param queues the list of queues to poll *//*from ww w .ja va 2 s.c o m*/ public SpringWorker(final Config config, final Collection<String> queues) { super(config, queues, Collections.EMPTY_MAP); this.name = createName(); }