RestMetadata

public class RestMetadata

The RestResponse class represents metadata of retrieved instances over REST. It contains entity name, entity class name, module name, namespace and pagination information

See also: org.motechproject.mds.rest.MdsRestFacade, org.motechproject.mds.rest.RestProjection, org.motechproject.mds.rest.RestMetadata

Constructors

RestMetadata

public RestMetadata()

Default constructor.

RestMetadata

public RestMetadata(String entity, String className, String moduleName, String namespace, Long totalCount, QueryParams queryParams)

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
  • totalCount – the total number of instances that match the search conditions
  • queryParams – the query params used to retrieve instances

Methods

getClassName

public String getClassName()
Returns:the class name of the entity

getEntity

public String getEntity()
Returns:the entity name

getModule

public String getModule()
Returns:the module name

getNamespace

public String getNamespace()
Returns:the namespace in which the entity is defined

getPage

public int getPage()
Returns:the page number

getPageSize

public int getPageSize()
Returns:the page size

getTotalCount

public long getTotalCount()
Returns:the total count of instances that match the search conditions

setClassName

public void setClassName(String className)
Parameters:
  • className – the class name of the entity

setEntity

public void setEntity(String entity)
Parameters:
  • entity – the entity name

setModule

public void setModule(String module)
Parameters:
  • module – the module name

setNamespace

public void setNamespace(String namespace)
Parameters:
  • namespace – the namespace in which the entity is defined

setPage

public void setPage(int page)
Parameters:
  • page – the page number

setPageSize

public void setPageSize(int pageSize)
Parameters:
  • pageSize – the page size

setTotalCount

public void setTotalCount(long totalCount)
Parameters:
  • totalCount – the total count of instances that match the search conditions