public interface ResourceBeanMapper
Resource
object to a bean.Modifier and Type | Method and Description |
---|---|
<T> T |
map(Resource resource,
Class<T> beanType)
Map a
Resource object to a bean of type . |
<T> Collection<T> |
mapCollection(ResourceCollection resourceCollection,
Class<T> beanType)
Map the child resources of the
ResourceCollection to a new collection of beanType to return. |
<T> void |
mapCollection(ResourceCollection resourceCollection,
Class<T> beanType,
Collection<T> targetBeanCollection)
Map the child resources of the
ResourceCollection and push them to the given targetBeanCollection
of beanType . |
<T> void |
mapCollection(ResourceCollection resourceCollection,
Class<T> beanType,
Collection<T> targetBeanCollection,
int offset,
int limit)
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. |
<T> Collection<T> |
mapCollection(ResourceCollection resourceCollection,
Class<T> beanType,
int offset,
int limit)
Map the child resources of the
ResourceCollection to a new collection of beanType to return. |
<T> T map(Resource resource, Class<T> beanType) throws ResourceException
Resource
object to a bean of type
.resource
- a Resource
object to convertbeanType
- type of bean to which the Resource
should be mappedResource
object to a bean of type
ResourceException
- if the resource
cannot be mapped to the beanType
<T> Collection<T> mapCollection(ResourceCollection resourceCollection, Class<T> beanType) throws ResourceException
ResourceCollection
to a new collection of beanType
to return.resourceCollection
- a ResourceCollection
objectbeanType
- type of bean to which the Resource
should be mappedresourceCollection
ResourceException
- if a resource
cannot be mapped to the beanType
<T> Collection<T> mapCollection(ResourceCollection resourceCollection, Class<T> beanType, int offset, int limit) throws ResourceException
ResourceCollection
to a new collection of beanType
to return.resourceCollection
- a ResourceCollection
objectbeanType
- type of bean to which the Resource
should be mappedoffset
- 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.resourceCollection
ResourceException
- if a resource
cannot be mapped to the beanType
<T> void mapCollection(ResourceCollection resourceCollection, Class<T> beanType, Collection<T> targetBeanCollection) throws ResourceException
ResourceCollection
and push them to the given targetBeanCollection
of beanType
.resourceCollection
- a ResourceCollection
objectbeanType
- type of bean to which the Resource
should be mappedtargetBeanCollection
- target collection of beans converted from the child resources of the resourceCollection
.ResourceException
- if a resource
cannot be mapped to the beanType
<T> void mapCollection(ResourceCollection resourceCollection, Class<T> beanType, Collection<T> targetBeanCollection, int offset, int limit) throws ResourceException
ResourceCollection
and push them to the given targetBeanCollection
of beanType
from the offset
index up to limit
size at max.resourceCollection
- a ResourceCollection
objectbeanType
- type of bean to which the Resource
should be mappedtargetBeanCollection
- 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.limit
- max size of resourceCollection
to convert from offset
index.
If limit is a negative value, it's ignored, meaning no limit being applied.ResourceException
- if a resource
cannot be mapped to the beanType
Copyright © 2017–2020 Hippo B.V. (http://www.onehippo.com). All rights reserved.