本文整理匯總了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;
}
}