Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

modelmapper abstract class

public void configure(ModelMapper modelMapper) {
    modelMapper.typeMap(QuestionDto.class, AbstractItem.class)
            .setConverter(converterWithDestinationSupplier(Question::new));
    modelMapper.typeMap(CriteriaDto.class, AbstractItem.class)
            .setConverter(converterWithDestinationSupplier(Criteria::new));
}

private <S, D> Converter<S, D> converterWithDestinationSupplier(Supplier<? extends D> supplier ) {
    return ctx -> ctx.getMappingEngine().map(ctx.create(ctx.getSource(), supplier.get()));
}
Comment

PREVIOUS NEXT
Code Example
Java :: add SOSL to apex Example 
Java :: Note: C:flutter..path_provider_android-2.0.11androidsrcmainjavaioflutterpluginspathproviderPathProviderPlugin.java uses unchecked or unsafe operations 
Java :: okhttp Sending and Receiving Network Requests 1 
Java :: how to extract value from payload in java 
Java :: speak function in java 
Java :: java active displays 
Java :: Removing Elements in java map 
Java :: sudoku 6x6 java 
Java :: how to secure specific url in spring security 
Java :: Double And Char In Java 
Java :: javax.annotation.PreDestroy cannot be found by org.eclipse.e4. 
Java :: save documents on Android 11 site:stackoverflow.com 
Java :: plot vector field in java 
Java :: hide tablayout tab android 
Java :: how do i get DefaultTableModel rows sum in column in java 
Java :: how to send images to storage using Admin Sdk in java 
Java :: https://java2blog.com/java-program-count-number-words-string/ 
Java :: Rotate array to left k cells python 
Java :: produces 
Java :: java.lang.ArrayIndexOutOfBoundsException: -1 
Java :: concatenar java 
Java :: Java Overloading by changing the number of parameters 
Java :: Run the ls command in the terminal to see the uncompiled .java file 
Java :: data base spring 
Java :: recursive in java 
Java :: break statement in Java switch...case 
Java :: android studio null 
Java :: system.out.println(h [2] [1] [1] [0]); 
Java :: make a string bean spring xml 
Java :: how to do 4th root java 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =