Examples of mapAsMap()


Examples of ma.glasnost.orika.MapperFacade.mapAsMap()

        sourceMap.put("B", 2);
        sourceMap.put("C", 3);
       
        MapperFacade mapper = MappingUtil.getMapperFactory().getMapperFacade();
       
        Map<String, Integer> result = mapper.mapAsMap(sourceMap, new TypeBuilder<Map<String, Integer>>(){}.build(), new TypeBuilder<Map<String, Integer>>(){}.build());
       
        Assert.assertNotNull(result);
        Assert.assertNotSame(sourceMap, result);
       
    }
View Full Code Here

Examples of ma.glasnost.orika.MapperFacade.mapAsMap()

            }
           
        });
        MapperFacade mapper = factory.getMapperFacade();
       
        Map<String, String> result = mapper.mapAsMap(sourceMap, new TypeBuilder<Map<String, Integer>>(){}.build(), new TypeBuilder<Map<String, String>>(){}.build());
       
        Assert.assertNotNull(result);
        Assert.assertNotSame(sourceMap, result);
        for (Entry<String, Integer> entry: sourceMap.entrySet()) {
            Assert.assertNotNull(result.get(entry.getKey()));
View Full Code Here

Examples of ma.glasnost.orika.MapperFacade.mapAsMap()

                .field("rank", "value")
                .byDefault().toClassMap());
               
        factory.registerConcreteType(Map.Entry.class, MapEntry.class);
        MapperFacade mapper = factory.getMapperFacade();
        Map<String, Integer> result = mapper.mapAsMap(source, rankingType, mapType);
       
        Assert.assertNotNull(result);
        Assert.assertEquals(source.size(), result.size());
        for (Ranking ranking: source) {
            Assert.assertTrue(result.get(ranking.getName()).equals(ranking.getRank()));
View Full Code Here

Examples of ma.glasnost.orika.MapperFacade.mapAsMap()

                .field("name", "key")
                .field("rank", "value")
                .byDefault().toClassMap());
               
        MapperFacade mapper = factory.getMapperFacade();
        Map<String, Integer> result = mapper.mapAsMap(source, TypeFactory.valueOf(Ranking.class), new TypeBuilder<Map<String, Integer>>(){}.build());
       
        Assert.assertNotNull(result);
        Assert.assertEquals(source.length, result.size());
        for (Ranking ranking: source) {
            Assert.assertTrue(result.get(ranking.getName()).equals(ranking.getRank()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.