Package no.unit.nva

Class PublicationMapper


  • public final class PublicationMapper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <R extends WithContext>
      R
      convertValue​(Publication publication, com.fasterxml.jackson.databind.JsonNode context, java.lang.Class<R> responseType)
      Maps a publication and context to specified type.
      static <R extends WithContext>
      R
      convertValue​(Publication publication, java.lang.Class<R> responseType)
      Maps a publication to specified type with default context.
      static <REQUEST extends PublicationBase>
      Publication
      toExistingPublication​(REQUEST request, WithInternal existing)
      Maps a publication request to a publication and copies internal properties from existing publication.
      static <REQUEST extends PublicationBase>
      Publication
      toNewPublication​(REQUEST request, java.lang.String owner, java.net.URI handle, java.net.URI link, Organization publisher)
      Maps a publication request to a new publication and sets internal properties for the first time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toExistingPublication

        public static <REQUEST extends PublicationBasePublication toExistingPublication​(REQUEST request,
                                                                                          WithInternal existing)
        Maps a publication request to a publication and copies internal properties from existing publication.
        Type Parameters:
        REQUEST - request type
        Parameters:
        request - publication request
        existing - existing publication to copy internal properties from
        Returns:
        complete updated publication
      • toNewPublication

        public static <REQUEST extends PublicationBasePublication toNewPublication​(REQUEST request,
                                                                                     java.lang.String owner,
                                                                                     java.net.URI handle,
                                                                                     java.net.URI link,
                                                                                     Organization publisher)
        Maps a publication request to a new publication and sets internal properties for the first time.
        Type Parameters:
        REQUEST - request type
        Parameters:
        request - publication request
        owner - owner
        handle - handle
        link - link
        publisher - publisher
        Returns:
        complete new publication
      • convertValue

        public static <R extends WithContext> R convertValue​(Publication publication,
                                                             com.fasterxml.jackson.databind.JsonNode context,
                                                             java.lang.Class<R> responseType)
        Maps a publication and context to specified type.
        Type Parameters:
        R - Type to be converted to.
        Parameters:
        publication - publication.
        context - jsonld context.
        responseType - Class to be converted to.
        Returns:
        publication response
      • convertValue

        public static <R extends WithContext> R convertValue​(Publication publication,
                                                             java.lang.Class<R> responseType)
        Maps a publication to specified type with default context.
        Type Parameters:
        R - Type to be converted to.
        Parameters:
        publication - publication.
        responseType - Class to be converted to.
        Returns:
        publication response