本文整理汇总了Java中org.mapstruct.factory.Mappers.getMapper方法的典型用法代码示例。如果您正苦于以下问题:Java Mappers.getMapper方法的具体用法?Java Mappers.getMapper怎么用?Java Mappers.getMapper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mapstruct.factory.Mappers
的用法示例。
在下文中一共展示了Mappers.getMapper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eventMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public EventMapper eventMapper(
EventDao dao,
HandicapGroupSetMapper handicapGroupSetMapper,
HandicapGroupSetService handicapGroupSetService,
CompetitionGroupSetMapper competitionGroupSetMapper,
CompetitionGroupSetService competitionGroupSetService
) {
EventMapper mapper = Mappers.getMapper(EventMapper.class);
mapper.setDao(dao);
mapper.setHandicapGroupSetMapper(handicapGroupSetMapper);
mapper.setHandicapGroupSetService(handicapGroupSetService);
mapper.setCompetitionGroupSetMapper(competitionGroupSetMapper);
mapper.setCompetitionGroupSetService(competitionGroupSetService);
return mapper;
}
示例2: registrationMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public RegistrationMapper registrationMapper(
RegistrationDao dao,
EventMapper eventMapper,
HandicapGroupMapper handicapGroupMapper,
HandicapGroupEntityService handicapGroupEntityService,
CompetitionGroupMapper competitionGroupMapper,
CompetitionGroupEntityService competitionGroupEntityService
) {
RegistrationMapper mapper = Mappers.getMapper(RegistrationMapper.class);
mapper.setDao(dao);
mapper.setEventMapper(eventMapper);
mapper.setHandicapGroupMapper(handicapGroupMapper);
mapper.setHandicapGroupEntityService(handicapGroupEntityService);
mapper.setCompetitionGroupMapper(competitionGroupMapper);
mapper.setCompetitionGroupEntityService(competitionGroupEntityService);
return mapper;
}
示例3: runMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public RunMapper runMapper(
RunDao dao,
EventMapper eventMapper,
EventEntityService eventEntityService,
RegistrationMapper registrationMapper,
RegistrationEntityService registrationEntityService
) {
RunMapper mapper = Mappers.getMapper(RunMapper.class);
mapper.setDao(dao);
mapper.setEventMapper(eventMapper);
mapper.setEventEntityService(eventEntityService);
mapper.setRegistrationMapper(registrationMapper);
mapper.setRegistrationEntityService(registrationEntityService);
return mapper;
}
示例4: KeyStorePasswordServiceImpl
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
public KeyStorePasswordServiceImpl(){
transformer = Mappers.getMapper(KeyStorePasswordTransformer.class);
}
示例5: testMapStructMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Test
public void testMapStructMapper() throws Exception {
MapStructBlogEntryMapper mapper = Mappers.getMapper(MapStructBlogEntryMapper.class);
BlogEntryResource result = mapper.toResourceBlogEntry(newBlogEntry());
Assert.assertEquals("title goes here", result.getTitle());
Assert.assertEquals("name", result.getAuthorName());
Assert.assertEquals("signature", result.getAuthorSignature());
Assert.assertEquals(1, result.getId().intValue());
Assert.assertNotNull(result.getProperties());
Assert.assertTrue(result.getProperties().isCommentsEnabled());
Assert.assertTrue(result.getProperties().isEnabled());
BlogEntry reverse = mapper.toJpaBlogEntry(result);
Assert.assertEquals("title goes here", reverse.getTitle());
Assert.assertEquals(1, reverse.getId().intValue());
Assert.assertTrue(reverse.isCommentsEnabled());
Assert.assertTrue(reverse.isEnabled());
Assert.assertNotNull(reverse.getAuthor());
Assert.assertEquals("name", reverse.getAuthor().getName());
Assert.assertEquals("signature", reverse.getAuthor().getSignature());
}
示例6: testMapStructMapperNullAuthor
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Test
public void testMapStructMapperNullAuthor() throws Exception {
MapStructBlogEntryMapper mapper = Mappers.getMapper(MapStructBlogEntryMapper.class);
Assert.assertNull(mapper.toJpaBlogEntry(null));
Assert.assertNull(mapper.toResourceBlogEntry(null));
BlogEntry be = newBlogEntry();
be.setAuthor(null);
BlogEntryResource result = mapper.toResourceBlogEntry(be);
Assert.assertNotNull(result);
Assert.assertEquals("title goes here", result.getTitle());
Assert.assertNull(result.getAuthorName());
Assert.assertNull(result.getAuthorSignature());
Assert.assertEquals(1, result.getId().intValue());
Assert.assertNotNull(result.getProperties());
Assert.assertTrue(result.getProperties().isCommentsEnabled());
Assert.assertTrue(result.getProperties().isEnabled());
}
示例7: testBasicMapping
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Test
void testBasicMapping() {
StockquoteBasic basic = new StockquoteBasic();
StockquoteMapper map = Mappers.getMapper(StockquoteMapper.class);
StockQuoteData stockdata = new StockQuoteData("123456789", Index.DAX);
stockdata.setStockname("STOCKNAME");
stockdata.setSymbol("SYMBOL");
stockdata.setFinancialYear(LocalDate.of(0, 12, 31));
SortedMap<YearEstimated, BigDecimal> treemap = new TreeMap<>();
treemap.put(new YearEstimated(Year.of(2016), true), new BigDecimal("2.3"));
stockdata.setEps(treemap);
basic = map.quoteToBasic(stockdata, basic);
}
示例8: competitionGroupMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public CompetitionGroupMapper competitionGroupMapper(CompetitionGroupDao dao) {
CompetitionGroupMapper mapper = Mappers.getMapper(CompetitionGroupMapper.class);
mapper.setDao(dao);
return mapper;
}
示例9: competitionGroupSetMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public CompetitionGroupSetMapper competitionGroupSetMapper(
CompetitionGroupSetDao dao,
CompetitionGroupMapper competitionGroupMapper
) {
CompetitionGroupSetMapper mapper = Mappers.getMapper(CompetitionGroupSetMapper.class);
mapper.setDao(dao);
mapper.setCompetitionGroupMapper(competitionGroupMapper);
return mapper;
}
示例10: handicapGroupMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public HandicapGroupMapper handicapGroupMapper(HandicapGroupDao dao) {
HandicapGroupMapper mapper = Mappers.getMapper(HandicapGroupMapper.class);
mapper.setDao(dao);
return mapper;
}
示例11: handicapGroupSetMapper
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Provides
@Singleton
public HandicapGroupSetMapper handicapGroupSetMapper(
HandicapGroupSetDao dao,
HandicapGroupMapper handicapGroupMapper
) {
HandicapGroupSetMapper mapper = Mappers.getMapper(HandicapGroupSetMapper.class);
mapper.setDao(dao);
mapper.setHandicapGroupMapper(handicapGroupMapper);
return mapper;
}
示例12: setup
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Before
public void setup() {
mapper = Mappers.getMapper(CompetitionGroupSetMapper.class);
mapper.setDao(dao);
CompetitionGroupMapper competitionGroupMapper = Mappers.getMapper(CompetitionGroupMapper.class);
competitionGroupMapper.setDao(competitionGroupDao);
mapper.setCompetitionGroupMapper(competitionGroupMapper);
}
示例13: setup
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Before
public void setup() {
mapper = Mappers.getMapper(EventMapper.class);
mapper.setHandicapGroupSetMapper(handicapGroupSetMapper);
mapper.setHandicapGroupSetService(handicapGroupSetService);
mapper.setCompetitionGroupSetMapper(competitionGroupSetMapper);
mapper.setCompetitionGroupSetService(competitionGroupSetService);
}
示例14: setup
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Before
public void setup() {
mapper = Mappers.getMapper(HandicapGroupSetMapper.class);
mapper.setDao(dao);
HandicapGroupMapper handicapGroupMapper = Mappers.getMapper(HandicapGroupMapper.class);
handicapGroupMapper.setDao(handicapGroupDao);
mapper.setHandicapGroupMapper(handicapGroupMapper);
}
示例15: testMapStructMapperNullAuthorName
import org.mapstruct.factory.Mappers; //导入方法依赖的package包/类
@Test
public void testMapStructMapperNullAuthorName() throws Exception {
MapStructBlogEntryMapper mapper = Mappers.getMapper(MapStructBlogEntryMapper.class);
BlogEntry be = newBlogEntry();
be.getAuthor().setName(null);
BlogEntryResource result = mapper.toResourceBlogEntry(be);
Assert.assertEquals("title goes here", result.getTitle());
Assert.assertNull(result.getAuthorName());
Assert.assertEquals("signature", result.getAuthorSignature());
Assert.assertEquals(1, result.getId().intValue());
Assert.assertNotNull(result.getProperties());
Assert.assertTrue(result.getProperties().isCommentsEnabled());
Assert.assertTrue(result.getProperties().isEnabled());
BlogEntry reverse = mapper.toJpaBlogEntry(result);
Assert.assertEquals("title goes here", reverse.getTitle());
Assert.assertEquals(1, reverse.getId().intValue());
Assert.assertTrue(reverse.isCommentsEnabled());
Assert.assertTrue(reverse.isEnabled());
Assert.assertNotNull(reverse.getAuthor());
Assert.assertNull(reverse.getAuthor().getName());
Assert.assertEquals("signature", reverse.getAuthor().getSignature());
}