本文整理汇总了Java中com.eclipsesource.json.JsonObject.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java JsonObject.getLong方法的具体用法?Java JsonObject.getLong怎么用?Java JsonObject.getLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.eclipsesource.json.JsonObject
的用法示例。
在下文中一共展示了JsonObject.getLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyFromJSONObject
import com.eclipsesource.json.JsonObject; //导入方法依赖的package包/类
public void copyFromJSONObject(JsonObject obj)
{
// Wire protocol fields
this.version = obj.getInt("ver", 1);
this.from = obj.getString("from", "");
this.message = obj.getString("message", "");
this.sign = obj.getString("sign", "");
this.threadID = obj.getString("threadid", "");
this.returnAddress = obj.getString("returnaddress", "");
// Additional fields - may be missing, get default values
this.transactionID = obj.getString("transactionID", "");
this.time = new Date(obj.getLong("time", 0));
this.direction = DIRECTION_TYPE.valueOf(
obj.getString("direction", DIRECTION_TYPE.RECEIVED.toString()));
this.verification = VERIFICATION_TYPE.valueOf(
obj.getString("verification", VERIFICATION_TYPE.UNVERIFIED.toString()));
if (obj.get("isanonymous") != null)
{
this.isAnonymous = obj.getBoolean("isanonymous", false);
} else
{
// Determine from content if it is anonymous
this.isAnonymous = obj.get("threadid") != null;
}
}