@Override public void populateEntity(final UserEntity entity, final User model) { Assert.notNull(entity, ENTITY_MUST_NOT_BE_NULL); Assert.notNull(model, USER_MUST_NOT_BE_NULL); entity.setId(model.getId()); entity.setUsername(model.getUsername()); }
@Override public User toModel(final UserEntity entity) { Assert.notNull(entity, ENTITY_MUST_NOT_BE_NULL); User model = new User(); model.setId(entity.getId()); model.setUsername(entity.getUsername()); return model; }