Interface DocumentMapper<T>


  • public interface DocumentMapper<T>
    • Method Detail

      • from

        T from​(ContentQueryRow row,
               Object... autowireObjects)
        Returns a view of this ContentQueryRow as a prototype bean with the given type
        Parameters:
        row - ContentQueryRow to map from
        autowireObjects - add any additional objects you wish to autowire. ContentQueryRow is always available for autowiring.
        Returns:
        ContentQueryRow mapped into new instance of clazz T
      • from

        T from​(ContentQueryRow row,
               BiConsumer<ContentQueryRow,​T> contentQueryRowBeanBiConsumer)
        Returns a view of this ContentQueryRow as a prototype bean with the given type
        Parameters:
        row - ContentQueryRow to map from
        contentQueryRowBeanBiConsumer - allowing further processing for each row with access to ContentQueryRow and the new bean.
        Returns:
        ContentQueryRow mapped into new instance of clazz T
      • fromDocumentAttributes

        T fromDocumentAttributes​(DocumentAttributes from)
        Converts document attributes into a new instance of the bean
        Parameters:
        from - attributes to convert
        Returns:
        the converted bean
      • fromDocumentAttributes

        void fromDocumentAttributes​(DocumentAttributes from,
                                    T target)
        Converts document attributes into an existing instance of a bean
        Parameters:
        from - attributes to convert
        target - bean to populate
      • toDocumentAttributes

        DocumentAttributes toDocumentAttributes​(T bean,
                                                boolean newDocument)
        Converts a bean to iKnowBase document attributes
        Parameters:
        bean - bean to save
        newDocument - whether to map properties mapped as "insertable", vs "updatable"
        Returns:
        mapped document attributes
      • getDocumentReference

        DocumentReference getDocumentReference​(T bean)
        Returns the DocumentReference for the bean, as specified by annotations.
        Parameters:
        bean - bean to extract reference for
        Returns:
        reference to iKnowBase document