Tag: orika

如何用Orika映射generics对象?

我正在使用Orika 1.4.5,我想让我的BidirectionalConverter将PaginatedResponse to PaginatedResponse映射PaginatedResponse to PaginatedResponse ,反之亦然。 PaginatedResponse类如下: public class PaginatedResponse { private List items; private List orderBy; private PagingResponse paging; public PaginatedResponse(List items, List orderBy, PagingResponse paging) { this.items = items; this.orderBy = orderBy; this.paging = paging; } // Getters } 所以我希望我的PaginatedResponseCovnerter接受所有的地图调用,其中转换是PaginatedResponse object1 to PaginatedResponse object2 ,我希望object1和object2具有相同的orderBy和paging属性。 所以我尝试这样做: public class PaginatedResponseConverter extends BidirectionalConverter<PaginatedResponse, PaginatedResponse> […]