本文整理汇总了Java中nxt.peer.Hallmark.parseHallmark方法的典型用法代码示例。如果您正苦于以下问题:Java Hallmark.parseHallmark方法的具体用法?Java Hallmark.parseHallmark怎么用?Java Hallmark.parseHallmark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nxt.peer.Hallmark
的用法示例。
在下文中一共展示了Hallmark.parseHallmark方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRequest
import nxt.peer.Hallmark; //导入方法依赖的package包/类
@Override
JSONStreamAware processRequest(HttpServletRequest req) {
String hallmarkValue = req.getParameter("hallmark");
if (hallmarkValue == null) {
return MISSING_HALLMARK;
}
try {
Hallmark hallmark = Hallmark.parseHallmark(hallmarkValue);
return JSONData.hallmark(hallmark);
} catch (RuntimeException e) {
return INCORRECT_HALLMARK;
}
}
示例2: processRequest
import nxt.peer.Hallmark; //导入方法依赖的package包/类
@Override
JSONStreamAware processRequest(HttpServletRequest req) {
String hallmarkValue = req.getParameter("hallmark");
if (hallmarkValue == null) {
return MISSING_HALLMARK;
}
try {
Hallmark hallmark = Hallmark.parseHallmark(hallmarkValue);
JSONObject response = new JSONObject();
response.put("account", Convert.toUnsignedLong(Account.getId(hallmark.getPublicKey())));
response.put("host", hallmark.getHost());
response.put("weight", hallmark.getWeight());
String dateString = Hallmark.formatDate(hallmark.getDate());
response.put("date", dateString);
response.put("valid", hallmark.isValid());
return response;
} catch (RuntimeException e) {
return INCORRECT_HALLMARK;
}
}
示例3: processRequest
import nxt.peer.Hallmark; //导入方法依赖的package包/类
JSONStreamAware processRequest(HttpServletRequest paramHttpServletRequest)
{
String str1 = paramHttpServletRequest.getParameter("hallmark");
if (str1 == null) {
return JSONResponses.MISSING_HALLMARK;
}
try
{
Hallmark localHallmark = Hallmark.parseHallmark(str1);
JSONObject localJSONObject = new JSONObject();
localJSONObject.put("account", Convert.toUnsignedLong(Account.getId(localHallmark.getPublicKey())));
localJSONObject.put("host", localHallmark.getHost());
localJSONObject.put("weight", Integer.valueOf(localHallmark.getWeight()));
String str2 = Hallmark.formatDate(localHallmark.getDate());
localJSONObject.put("date", str2);
localJSONObject.put("valid", Boolean.valueOf(localHallmark.isValid()));
return localJSONObject;
}
catch (RuntimeException localRuntimeException) {}
return JSONResponses.INCORRECT_HALLMARK;
}