MapStruct - Java bean mappings, the easy way!
Java Bean之间的映射器,通过接口定义自动完成转换类的实现,解放双手
public class Car {
private String make;
private int numberOfSeats;
private CarType type;
//constructor, getters, setters etc.
}
public class CarDto {
private String make;
private int seatCount;
private String type;
//constructor, getters, setters etc.
}
@Mapper
public interface CarMapper {
CarMapper INSTANCE = Mappers.getMapper( CarMapper.class );
//map for field that in differrent name.
@Mapping(source = "numberOfSeats", target = "seatCount")
CarDto carToCarDto(Car car);
}
Querydsl - Unified Queries for Java
基于Java8的复杂数据库查询,采用Java链式调用实现了类似于SQL查询的语句。
著名的Java工具类
Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multiset), immutable collections, a graph library, and utilities for concurrency, I/O, hashing, caching, primitives, strings, and more! It is widely used on most Java projects within Google, and widely used by many other companies as well.
除了让Java用起来更愉悦的基础工具类以外,还有集合、图、缓存、函数式编程、字符串、Java不支持的原始类型、范围、I/O、哈希、事件总线、反射、数学等多个模块。可以按需使用
API Documentation & Design Tools for Teams | Swagger
API查看神器。支持API浏览、查看入参出参、测试等。
Java的Mock资源库。使用when()、then()、verify()等方法可以很快速地mock和验证返回值。