Skip to content

Introduction

MapStruct is a Java annotation processor for the generation of type-safe bean mapping classes.

All you have to do is to define a mapper interface which declares any required mapping methods. During compilation, MapStruct will generate an implementation of this interface. This implementation uses plain Java method invocations for mapping between source and target objects, i.e. no reflection or similar.

Compared to writing mapping code from hand, MapStruct saves time by generating code which is tedious and error-prone to write. Following a convention over configuration approach, MapStruct uses sensible defaults but steps out of your way when it comes to configuring or implementing special behavior.

Compared to dynamic mapping frameworks, MapStruct offers the following advantages:

Fast execution by using plain method invocations instead of reflection

Compile-time type safety: Only objects and attributes mapping to each other can be mapped, no accidental mapping of an order entity into a customer DTO etc.

Clear error-reports at build time, if

mappings are incomplete (not all target properties are mapped)

mappings are incorrect (cannot find a proper mapping method or type conversion)

题目描述

给定一个字符串 s ,找出至多包含 k 个不同字符的最长子串 T

解题思路

视频讲解

大神Leo英文流讲解, 欢迎订阅频道
CC BY-NC-ND 4.0

版权声明

本作品采用 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议 进行许可。

转载需满足以下条件:

  • 显著标注原作者及来源
  • 不得用于商业目的
  • 禁止任何形式的修改或演绎

Atomeocean Open Source Mapstruct