/**
*
- * This class provides utility for making CoAP request and response.
+ * This class provides a set of APIs to build build data of CoAP request and
+ * response type.
*
*/
public class CoapMessageBuilder {
public static final int APPLICATION_JSON = 50;
+ /**
+ * API for building data of CoAP response type without payload.
+ *
+ * @param token
+ * token
+ * @param status
+ * response status
+ * @return CoapResponse - data of CoAP response type
+ */
public CoapResponse buildCoapResponse(byte[] token, CoapStatus status) {
return buildCoapResponse(token, null, status);
}
+ /**
+ * API for building data of CoAP response type with payload.
+ *
+ * @param token
+ * token
+ * @param jsonString
+ * payload data
+ * @param status
+ * response status
+ * @return CoapResponse - data of CoAP response type
+ */
public CoapResponse buildCoapResponse(byte[] token, String jsonString,
CoapStatus status) {
return coapResponse;
}
+ /**
+ * API for building data of CoAP requeset type with payload.
+ *
+ * @param token
+ * token
+ * @param jsonString
+ * payload data
+ * @return CoapRequest - data of CoAP request type
+ */
public CoapRequest buildCoapRequest(byte[] token, String jsonString) {
CoapRequest coapRequest = new CoapRequest(CoapMethod.GET);