RestResponse¶
-
public class
RestResponse
¶ The
RestResponse
class represents data retrieved over REST. It contains metadata and data.See also:
org.motechproject.mds.rest.MdsRestFacade
,org.motechproject.mds.rest.RestProjection
,org.motechproject.mds.rest.RestMetadata
Constructors¶
RestResponse¶
-
public
RestResponse
(String entity, String className, String moduleName, String namespace, Long totalSize, QueryParams queryParams, List<RestProjection> data)¶ Constructor.
Parameters: - entity – the entity name
- className – the name of the entity class
- moduleName – the module name
- namespace – the namespace in which the entity is defined
- totalSize – the total number of data that match the search conditions
- queryParams – the query params used to retrieve data
- data – the list of the data
RestResponse¶
-
public
RestResponse
(String entity, String className, String moduleName, String namespace, Long totalSize, QueryParams queryParams, RestProjection data)¶ Constructor.
Parameters: - entity – the entity name
- className – the name of the entity class
- moduleName – the module name
- namespace – the namespace in which the entity is defined
- totalSize – the total number of data that match the search conditions
- queryParams – the query params used to retrieve data
- data – the record
Methods¶
getData¶
-
public List<RestProjection>
getData
()¶ Returns: the list of the data
getMetadata¶
-
public RestMetadata
getMetadata
()¶ Returns: the metadata for the response
setData¶
-
public void
setData
(List<RestProjection> data)¶ Parameters: - data – the list of the data
setMetadata¶
-
public void
setMetadata
(RestMetadata metadata)¶ Parameters: - metadata – the metadata for the response