mpple
default sample
public class Foo {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
public class FooDto {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
public interface FooMapper {
FooDto foo(Foo foo);
}
public static void main(String[] args) {
FooMapper fooMapper = Mpple.builder()
.target(FooMapper.class);
Foo foo = new Foo();
foo.setFirstName("wonwoo");
foo.setLastName("lee");
assertThat(fooMapper.foo(foo).getFirstName()).isEqualTo("wonwoo");
}
for spring
@EnableMppled
public class MppleSpringConfig {
}
@Mppled
public interface FooMapper {
FooDto foo(Foo foo);
}
@Autowired
private FooMapper fooMapper;
@Test
public void mappingTest() {
Foo foo = new Foo();
foo.setFirstName("wonwoo");
foo.setLastName("lee");
FooDto fooDto = fooMapper.foo(foo);
assertThat(fooDto.getFirstName()).isEqualTo("wonwoo");
assertThat(fooDto.getLastName()).isEqualTo("lee");
}
for spring boot
spring boot is default modelmapper
@Mppled
public interface FooMapper {
FooDto foo(Foo foo);
}
@Autowired
private FooMapper fooMapper;
@Test
public void mappingTest() {
Foo foo = new Foo();
foo.setFirstName("wonwoo");
foo.setLastName("lee");
FooDto fooDto = fooMapper.foo(foo);
assertThat(fooDto.getFirstName()).isEqualTo("wonwoo");
assertThat(fooDto.getLastName()).isEqualTo("lee");
}
config
TODO

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
