diff --git a/orika/pom.xml b/orika/pom.xml
new file mode 100644
index 0000000000..86375c260e
--- /dev/null
+++ b/orika/pom.xml
@@ -0,0 +1,50 @@
+
+ 4.0.0
+ com.baeldung
+ orika
+ 1.0
+ Orika
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.3
+
+
+ 7
+
+
+
+
+
+
+
+
+ org.slf4j
+ slf4j-api
+ 1.7.5
+
+
+
+ org.slf4j
+ jcl-over-slf4j
+ 1.7.5
+
+
+
+ ma.glasnost.orika
+ orika-core
+ 1.4.6
+
+
+
+ junit
+ junit
+ 4.3
+ test
+
+
+
+
diff --git a/orika/src/main/java/com/baeldung/orika/Dest.java b/orika/src/main/java/com/baeldung/orika/Dest.java
new file mode 100644
index 0000000000..ffacca8f00
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Dest.java
@@ -0,0 +1,38 @@
+package com.baeldung.orika;
+
+public class Dest {
+ @Override
+ public String toString() {
+ return "Dest [name=" + name + ", age=" + age + "]";
+ }
+
+ private String name;
+ private int age;
+
+ public Dest() {
+
+ }
+
+ public Dest(String name, int age) {
+ super();
+ this.name = name;
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/Name.java b/orika/src/main/java/com/baeldung/orika/Name.java
new file mode 100644
index 0000000000..68c9d47499
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Name.java
@@ -0,0 +1,29 @@
+package com.baeldung.orika;
+
+public class Name {
+ private String firstName;
+ private String lastName;
+
+ public Name(String firstName, String lastName) {
+ super();
+ this.firstName = firstName;
+ this.lastName = 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;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/Person.java b/orika/src/main/java/com/baeldung/orika/Person.java
new file mode 100644
index 0000000000..29f715b174
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Person.java
@@ -0,0 +1,49 @@
+package com.baeldung.orika;
+
+public class Person {
+ @Override
+ public String toString() {
+ return "Person [name=" + name + ", nickname=" + nickname + ", age="
+ + age + "]";
+ }
+
+ private String name;
+ private String nickname;
+ private int age;
+
+ public Person() {
+
+ }
+
+ public Person(String name, String nickname, int age) {
+ super();
+ this.name = name;
+ this.nickname = nickname;
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNickname() {
+ return nickname;
+ }
+
+ public void setNickname(String nickname) {
+ this.nickname = nickname;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/Person3.java b/orika/src/main/java/com/baeldung/orika/Person3.java
new file mode 100644
index 0000000000..b946aeec40
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Person3.java
@@ -0,0 +1,39 @@
+package com.baeldung.orika;
+
+public class Person3 {
+ private String name;
+ private String dtob;
+
+ public Person3() {
+
+ }
+
+ public Person3(String name, String dtob) {
+ super();
+ this.name = name;
+ this.dtob = dtob;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDtob() {
+ return dtob;
+ }
+
+ public void setDtob(String dtob) {
+ this.dtob = dtob;
+ }
+
+ @Override
+ public String toString() {
+ return "Person3 [name=" + name + ", dtob=" + dtob + "]";
+ }
+
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/PersonContainer.java b/orika/src/main/java/com/baeldung/orika/PersonContainer.java
new file mode 100644
index 0000000000..2955035458
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/PersonContainer.java
@@ -0,0 +1,19 @@
+package com.baeldung.orika;
+
+public class PersonContainer {
+ private Name name;
+
+ public PersonContainer(Name name) {
+ super();
+ this.name = name;
+ }
+
+ public Name getName() {
+ return name;
+ }
+
+ public void setName(Name name) {
+ this.name = name;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/PersonListContainer.java b/orika/src/main/java/com/baeldung/orika/PersonListContainer.java
new file mode 100644
index 0000000000..e70f34f29d
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/PersonListContainer.java
@@ -0,0 +1,21 @@
+package com.baeldung.orika;
+
+import java.util.List;
+
+public class PersonListContainer {
+ private List names;
+
+ public PersonListContainer(List names) {
+ super();
+ this.names = names;
+ }
+
+ public List getNames() {
+ return names;
+ }
+
+ public void setNames(List names) {
+ this.names = names;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/PersonNameArray.java b/orika/src/main/java/com/baeldung/orika/PersonNameArray.java
new file mode 100644
index 0000000000..e985924cda
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/PersonNameArray.java
@@ -0,0 +1,19 @@
+package com.baeldung.orika;
+
+public class PersonNameArray {
+ private String[] nameArray;
+
+ public PersonNameArray(String[] nameArray) {
+ super();
+ this.nameArray = nameArray;
+ }
+
+ public String[] getNameArray() {
+ return nameArray;
+ }
+
+ public void setNameArray(String[] nameArray) {
+ this.nameArray = nameArray;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/PersonNameList.java b/orika/src/main/java/com/baeldung/orika/PersonNameList.java
new file mode 100644
index 0000000000..46398c3782
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/PersonNameList.java
@@ -0,0 +1,21 @@
+package com.baeldung.orika;
+
+import java.util.List;
+
+public class PersonNameList {
+ private List nameList;
+
+ public PersonNameList(List nameList) {
+ super();
+ this.nameList = nameList;
+ }
+
+ public List getNameList() {
+ return nameList;
+ }
+
+ public void setNameList(List nameList) {
+ this.nameList = nameList;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/PersonNameMap.java b/orika/src/main/java/com/baeldung/orika/PersonNameMap.java
new file mode 100644
index 0000000000..ba802dfb32
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/PersonNameMap.java
@@ -0,0 +1,26 @@
+package com.baeldung.orika;
+
+import java.util.Map;
+
+public class PersonNameMap {
+ private Map nameMap;
+
+ public PersonNameMap(Map nameMap) {
+ super();
+ this.nameMap = nameMap;
+ }
+
+ public PersonNameMap() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public Map getNameMap() {
+ return nameMap;
+ }
+
+ public void setNameMap(Map nameList) {
+ this.nameMap = nameList;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/PersonNameParts.java b/orika/src/main/java/com/baeldung/orika/PersonNameParts.java
new file mode 100644
index 0000000000..5c4e14ef92
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/PersonNameParts.java
@@ -0,0 +1,29 @@
+package com.baeldung.orika;
+
+public class PersonNameParts {
+ private String firstName;
+ private String lastName;
+
+ public PersonNameParts(String firstName, String lastName) {
+ super();
+ this.firstName = firstName;
+ this.lastName = 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;
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/Personne.java b/orika/src/main/java/com/baeldung/orika/Personne.java
new file mode 100644
index 0000000000..29887d9987
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Personne.java
@@ -0,0 +1,49 @@
+package com.baeldung.orika;
+
+public class Personne {
+ private String nom;
+ private String surnom;
+ private int age;
+
+ public Personne() {
+
+ }
+
+ public Personne(String nom, String surnom, int age) {
+ super();
+ this.nom = nom;
+ this.surnom = surnom;
+ this.age = age;
+ }
+
+ public String getNom() {
+ return nom;
+ }
+
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
+
+ public String getSurnom() {
+ return surnom;
+ }
+
+ public void setSurnom(String surnom) {
+ this.surnom = surnom;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ @Override
+ public String toString() {
+ return "Personne [nom=" + nom + ", surnom=" + surnom + ", age=" + age
+ + "]";
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/Personne3.java b/orika/src/main/java/com/baeldung/orika/Personne3.java
new file mode 100644
index 0000000000..25175c241f
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Personne3.java
@@ -0,0 +1,38 @@
+package com.baeldung.orika;
+
+public class Personne3 {
+ private String name;
+ private long dtob;
+
+ public Personne3() {
+
+ }
+
+ public Personne3(String name, long dtob) {
+ super();
+ this.name = name;
+ this.dtob = dtob;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public long getDtob() {
+ return dtob;
+ }
+
+ public void setDtob(long dtob) {
+ this.dtob = dtob;
+ }
+
+ @Override
+ public String toString() {
+ return "Personne3 [name=" + name + ", dtob=" + dtob + "]";
+ }
+
+}
diff --git a/orika/src/main/java/com/baeldung/orika/Source.java b/orika/src/main/java/com/baeldung/orika/Source.java
new file mode 100644
index 0000000000..0b449960d6
--- /dev/null
+++ b/orika/src/main/java/com/baeldung/orika/Source.java
@@ -0,0 +1,37 @@
+package com.baeldung.orika;
+
+public class Source {
+ @Override
+ public String toString() {
+ return "Source [name=" + name + ", age=" + age + "]";
+ }
+
+ private String name;
+ private int age;
+
+ public Source() {
+ }
+
+ public Source(String name, int age) {
+ super();
+ this.name = name;
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+}
diff --git a/orika/src/test/java/com/baeldung/orika/OrikaTest.java b/orika/src/test/java/com/baeldung/orika/OrikaTest.java
new file mode 100644
index 0000000000..90411a74eb
--- /dev/null
+++ b/orika/src/test/java/com/baeldung/orika/OrikaTest.java
@@ -0,0 +1,394 @@
+package com.baeldung.orika;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import ma.glasnost.orika.BoundMapperFacade;
+import ma.glasnost.orika.CustomMapper;
+import ma.glasnost.orika.MapperFacade;
+import ma.glasnost.orika.MapperFactory;
+import ma.glasnost.orika.MappingContext;
+import ma.glasnost.orika.impl.DefaultMapperFactory;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class OrikaTest {
+ MapperFactory mapperFactory;
+ CustomMapper customMapper;
+ // constant to help us cover time zone differences
+ private final long GMT_DIFFERENCE = 46800000;
+
+ @Before
+ public void before() {
+ mapperFactory = new DefaultMapperFactory.Builder().build();
+ customMapper = new CustomMapper() {
+
+ @Override
+ public void mapAtoB(Personne3 a, Person3 b, MappingContext context) {
+ Date date = new Date(a.getDtob());
+ DateFormat format = new SimpleDateFormat(
+ "yyyy-MM-dd'T'HH:mm:ss'Z'");
+ String isoDate = format.format(date);
+ b.setDtob(isoDate);
+ }
+
+ @Override
+ public void mapBtoA(Person3 b, Personne3 a, MappingContext context) {
+ DateFormat format = new SimpleDateFormat(
+ "yyyy-MM-dd'T'HH:mm:ss'Z'");
+ Date date = null;
+ try {
+ date = format.parse(b.getDtob());
+
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ long timestamp = date.getTime();
+ a.setDtob(timestamp);
+ }
+
+ };
+ }
+
+ @Test
+ public void givenSrcAndDest_whenMaps_thenCorrect() {
+ mapperFactory.classMap(Source.class, Dest.class);
+ MapperFacade mapper = mapperFactory.getMapperFacade();
+ Source src = new Source("Baeldung", 10);
+ Dest dest = mapper.map(src, Dest.class);
+ assertEquals(dest.getAge(), src.getAge());
+ assertEquals(dest.getName(), src.getName());
+ }
+
+ @Test
+ public void givenSrcAndDest_whenMapsReverse_thenCorrect() {
+ mapperFactory.classMap(Source.class, Dest.class).byDefault();
+ MapperFacade mapper = mapperFactory.getMapperFacade();
+ Dest src = new Dest("Baeldung", 10);
+ Source dest = mapper.map(src, Source.class);
+ assertEquals(dest.getAge(), src.getAge());
+ assertEquals(dest.getName(), src.getName());
+ }
+
+ @Test
+ public void givenSrcAndDest_whenMapsByObject_thenCorrect() {
+ mapperFactory.classMap(Source.class, Dest.class).byDefault();
+ MapperFacade mapper = mapperFactory.getMapperFacade();
+ Source src = new Source("Baeldung", 10);
+ Dest dest = new Dest();
+ mapper.map(src, dest);
+ assertEquals(dest.getAge(), src.getAge());
+ assertEquals(dest.getName(), src.getName());
+ }
+
+ @Test
+ public void givenSrcAndDest_whenMapsUsingBoundMapper_thenCorrect() {
+ BoundMapperFacade