Automapping facility

If classes on the mapping sides are almost of the same structure, i.e. contains properties of the same names which should be mapped to each other according to business rules, you have no need to define mapping between properties of the same name.

  public class Entity {
    private String a;
    private String b;
    private String c;
    private String notMatchedByName;
    ...
  }

  public class EntityDTO {
    private String a;
    private String b;
    private String c;
    private String notMatchedByName2;
    ...
  }

  mappingFor a: Entity, b: EntityDTO
  automap()

  // the rest of mapping rules
  a.notMatchedByName = b.notMatchedByName2

The above mapping defines mapping rules between properties a, b, c of the sides automatically.

Suppose the above structures, Entity and EntityDTO, have no differences. So in that case you don't have to define a mapping between classes, Nomin can create it for you. Nomin's automapping facility is enabled by default, it can be disabled through calling NominMapper.disableAutomapping.

  NominMapper nomin = new Nomin();
  EntityA entityA = nomin.map(entityB, EntityA.class);