Skip to content

cloudogu/conveyor

Repository files navigation

Conveyor

Generate dtos from annotations.

Why?

There are a lot of dto mapping libraries out there, so why create another one? Conveyor was created to support the special needs of SCM-Manager. For SCM-Manager we wanted a library which support the following features:

  • Simple to use
  • As little boilerplate code as possible
  • Support of _links and _embedded of HAL
  • Support views to keep our OpenAPI documentation clean
  • Copy annotations from source entity

So we decided to create another dto mapping library.

Usage

@GenerateDto
public class Person {

  @Include
  private String firstName;
  @Include
  private String lastName;
  
  // constructor, getter and setter
}

Conveyor will automatically create a PersonDto class, which can be used as follows:

Person person = new Person("Tricia", "McMillan");

Links links = Links.linkingTo()
  .self("/people/trillian")
  .build();

PersonDto dto = PersonDto.from(person, links);

Installation

Get the latest stable version from Maven Central

Gradle

implementation 'de.otto.edison:edison-hal:2.1.0'
compileOnly 'com.cloudogu.conveyor:conveyor:x.y.z'
annotationProcessor 'com.cloudogu.conveyor:conveyor:x.y.z'

Maven

<dependency>
  <groupId>de.otto.edison</groupId>
  <artifactId>edison-hal</artifactId>
  <version>2.1.0</version>
</dependency>

<dependency>
  <groupId>com.cloudogu.conveyor</groupId>
  <artifactId>conveyor</artifactId>
  <version>x.y.z</version>
  <optional>true</optional>
</dependency>

License

This project is licensed under the MIT License - see the LICENSE file for details