Пример #1
0
  /** Get string JSON representation of this scheme */
  public String toJSONString() {

    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
    nameValuePairs.add(new BasicNameValuePair("method", method.toString()));
    nameValuePairs.add(new BasicNameValuePair("dataFormat", format.toString()));
    nameValuePairs.add(new BasicNameValuePair("kSecret", keySecret));
    nameValuePairs.add(new BasicNameValuePair("kFrom", keyFrom));
    nameValuePairs.add(new BasicNameValuePair("kSentTimestamp", keySentTimeStamp));
    nameValuePairs.add(new BasicNameValuePair("kMessage", keyMessage));
    nameValuePairs.add(new BasicNameValuePair("kSentTo", keySentTo));
    nameValuePairs.add(new BasicNameValuePair("kMessageID", keyMessageID));
    nameValuePairs.add(new BasicNameValuePair("kDeviceID", keyDeviceID));

    try {
      return DataFormatUtil.makeJSONString(nameValuePairs);
    } catch (JSONException ex) {
      return null;
    }
  }
Пример #2
0
 @Override
 public String toString() {
   return "SyncScheme {"
       + "method:"
       + method.toString()
       + ", dataFormat:"
       + format.toString()
       + ", keys: ["
       + keyFrom
       + ","
       + keySecret
       + ","
       + keyMessage
       + ","
       + keySentTo
       + ","
       + keySentTimeStamp
       + ","
       + keyMessageID
       + ","
       + keyDeviceID
       + "] "
       + "}";
 }