Class AbstractResourceBeanMapper

    • Constructor Detail

      • AbstractResourceBeanMapper

        public AbstractResourceBeanMapper()
    • Method Detail

      • mapCollection

        public <T> Collection<T> mapCollection​(ResourceCollection resourceCollection,
                                               Class<T> beanType,
                                               int offset,
                                               int limit)
                                        throws ResourceException
        Description copied from interface: ResourceBeanMapper
        Map the child resources of the ResourceCollection to a new collection of beanType to return.
        Specified by:
        mapCollection in interface ResourceBeanMapper
        Parameters:
        resourceCollection - a ResourceCollection object
        beanType - type of bean to which the Resource should be mapped
        offset - start index of resourceCollection to convert from. If offset is a negative value, it's ignored, meaning zero index being effective.
        limit - max size of resourceCollection to convert from offset index. If limit is a negative value, it's ignored, meaning no limit being applied.
        Returns:
        a new collection of beans converted from the child resources of the resourceCollection
        Throws:
        ResourceException - if a resource cannot be mapped to the beanType
      • mapCollection

        public <T> void mapCollection​(ResourceCollection resourceCollection,
                                      Class<T> beanType,
                                      Collection<T> targetBeanCollection,
                                      int offset,
                                      int length)
                               throws ResourceException
        Description copied from interface: ResourceBeanMapper
        Map the child resources of the ResourceCollection and push them to the given targetBeanCollection of beanType from the offset index up to limit size at max.
        Specified by:
        mapCollection in interface ResourceBeanMapper
        Parameters:
        resourceCollection - a ResourceCollection object
        beanType - type of bean to which the Resource should be mapped
        targetBeanCollection - target collection of beans converted from the child resources of the resourceCollection.
        offset - start index of resourceCollection to convert from. If offset is a negative value, it's ignored, meaning zero index being effective.
        length - max size of resourceCollection to convert from offset index. If limit is a negative value, it's ignored, meaning no limit being applied.
        Throws:
        ResourceException - if a resource cannot be mapped to the beanType