java.lang.Object
com.irurueta.authserver.bff.infrastructure.resourceserver.DocumentMapper

@Component public class DocumentMapper extends Object
Maps the model of the generated resource-server client onto the domain, so the generated types never leave this adapter.
  • Constructor Details

    • DocumentMapper

      public DocumentMapper()
  • Method Details

    • toDomain

      public Document toDomain(DocumentResponse response)
      Maps a document answered by the resource server.
      Parameters:
      response - the document as the generated client reads it.
      Returns:
      the domain document.
      Throws:
      IllegalArgumentException - if the resource server answered a document that breaks the domain invariants.