java.lang.Object
com.irurueta.authserver.resourceserver.api.web.documents.DocumentDtoMapper

@Component public class DocumentDtoMapper extends Object
Maps domain documents onto the DTO generated from the contract, so a domain model is never returned from DocumentController.
  • Constructor Details

    • DocumentDtoMapper

      public DocumentDtoMapper()
  • Method Details

    • toResponse

      public DocumentResponse toResponse(Document document)
      Maps one document.
      Parameters:
      document - the domain document.
      Returns:
      its web representation.
    • toResponses

      public List<DocumentResponse> toResponses(List<Document> documents)
      Maps several documents, keeping their order.
      Parameters:
      documents - the domain documents.
      Returns:
      their web representations.