BaseEntityConverter.java 443 B

1234567891011121314151617181920212223242526
  1. package com.zhixinghe1.ots.common.converter.mapstruct;
  2. /**
  3. * 对象转换工具
  4. *
  5. * @param <Entity>
  6. * @param <Dto>
  7. */
  8. public interface BaseEntityConverter<Entity, Dto> {
  9. /**
  10. * 实体对象转换为DTO对象
  11. *
  12. * @param entity
  13. * @return
  14. */
  15. Dto convert2Dto(Entity entity);
  16. /**
  17. * DTO对象转换为实体对象
  18. *
  19. * @param dto
  20. * @return
  21. */
  22. Entity convert2Entity(Dto dto);
  23. }