當前位置: 首頁>>代碼示例>>Java>>正文


Java ExtendedJSONObject.getBoolean方法代碼示例

本文整理匯總了Java中org.mozilla.gecko.sync.ExtendedJSONObject.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java ExtendedJSONObject.getBoolean方法的具體用法?Java ExtendedJSONObject.getBoolean怎麽用?Java ExtendedJSONObject.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.mozilla.gecko.sync.ExtendedJSONObject的用法示例。


在下文中一共展示了ExtendedJSONObject.getBoolean方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unpickleV3

import org.mozilla.gecko.sync.ExtendedJSONObject; //導入方法依賴的package包/類
private void unpickleV3(final ExtendedJSONObject json)
    throws NonObjectJSONException, NoSuchAlgorithmException, InvalidKeySpecException {
  // We'll overwrite the extracted sync automatically map.
  unpickleV1(json);

  // Extract the map of authorities to sync automatically.
  authoritiesToSyncAutomaticallyMap.clear();
  final ExtendedJSONObject o = json.getObject(KEY_AUTHORITIES_TO_SYNC_AUTOMATICALLY_MAP);
  if (o == null) {
    return;
  }
  for (String key : o.keySet()) {
    final Boolean enabled = o.getBoolean(key);
    if (enabled != null) {
      authoritiesToSyncAutomaticallyMap.put(key, enabled);
    }
  }
}
 
開發者ID:jrconlin,項目名稱:mc_backup,代碼行數:19,代碼來源:AccountPickler.java

示例2: fromJSONObjectV3

import org.mozilla.gecko.sync.ExtendedJSONObject; //導入方法依賴的package包/類
/**
 * Exactly the same as {@link fromJSONObjectV2}, except that there's a new
 * MigratedFromSyncV11 state.
 */
protected static State fromJSONObjectV3(StateLabel stateLabel, ExtendedJSONObject o) throws InvalidKeySpecException, NoSuchAlgorithmException, NonObjectJSONException {
  switch (stateLabel) {
  case MigratedFromSync11:
    return new MigratedFromSync11(
        o.getString("email"),
        o.getString("uid"),
        o.getBoolean("verified"),
        o.getString("password"));
  default:
    return fromJSONObjectV2(stateLabel, o);
  }
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:17,代碼來源:StateFactory.java

示例3: getBundleDataBoolean

import org.mozilla.gecko.sync.ExtendedJSONObject; //導入方法依賴的package包/類
protected boolean getBundleDataBoolean(String key, boolean def) {
  ExtendedJSONObject o = unbundle();
  if (o == null) {
    return def;
  }
  Boolean b = o.getBoolean(key);
  if (b == null) {
    return def;
  }
  return b;
}
 
開發者ID:jrconlin,項目名稱:mc_backup,代碼行數:12,代碼來源:AndroidFxAccount.java

示例4: fromJSONObjectV1

import org.mozilla.gecko.sync.ExtendedJSONObject; //導入方法依賴的package包/類
protected static State fromJSONObjectV1(StateLabel stateLabel, ExtendedJSONObject o) throws InvalidKeySpecException, NoSuchAlgorithmException, NonObjectJSONException {
  switch (stateLabel) {
  case Engaged:
    return new Engaged(
        o.getString("email"),
        o.getString("uid"),
        o.getBoolean("verified"),
        Utils.hex2Byte(o.getString("unwrapkB")),
        Utils.hex2Byte(o.getString("sessionToken")),
        Utils.hex2Byte(o.getString("keyFetchToken")));
  case Cohabiting:
    return new Cohabiting(
        o.getString("email"),
        o.getString("uid"),
        Utils.hex2Byte(o.getString("sessionToken")),
        Utils.hex2Byte(o.getString("kA")),
        Utils.hex2Byte(o.getString("kB")),
        keyPairFromJSONObjectV1(o.getObject("keyPair")));
  case Married:
    return new Married(
        o.getString("email"),
        o.getString("uid"),
        Utils.hex2Byte(o.getString("sessionToken")),
        Utils.hex2Byte(o.getString("kA")),
        Utils.hex2Byte(o.getString("kB")),
        keyPairFromJSONObjectV1(o.getObject("keyPair")),
        o.getString("certificate"));
  case Separated:
    return new Separated(
        o.getString("email"),
        o.getString("uid"),
        o.getBoolean("verified"));
  case Doghouse:
    return new Doghouse(
        o.getString("email"),
        o.getString("uid"),
        o.getBoolean("verified"));
  default:
    throw new IllegalStateException("unrecognized state label: " + stateLabel);
  }
}
 
開發者ID:mozilla-mobile,項目名稱:FirefoxData-android,代碼行數:42,代碼來源:StateFactory.java

示例5: fromCursorRow

import org.mozilla.gecko.sync.ExtendedJSONObject; //導入方法依賴的package包/類
/**
 * TODO: optionally produce a partial record by examining SYNC_CHANGE_FLAGS/SYNC_STATUS.
 */
public ClientReadingListRecord fromCursorRow() {
  final ExtendedJSONObject object = new ExtendedJSONObject();
  for (int i = 0; i < this.fields.length; ++i) {
    final String field = fields[i];
    if (field == null) {
      continue;
    }
    final int column = this.columns[i];
    if (Versions.feature11Plus) {
      fillHoneycomb(object, this.cursor, field, column);
    } else {
      fillGingerbread(object, this.cursor, field, column);
    }
  }

  // Apply cross-field constraints.
  if (object.containsKey("unread") && object.getBoolean("unread")) {
    object.remove("marked_read_by");
    object.remove("marked_read_on");
  }

  // Construct server metadata and client metadata from the object.
  final long serverLastModified = object.getLong("last_modified", -1L);
  final String guid = object.containsKey("guid") ? object.getString("guid") : null;
  final ServerMetadata sm = new ServerMetadata(guid, serverLastModified);

  final long clientLastModified = object.getLong("client_last_modified", -1L);

  // This has already been translated...
  final boolean isArchived = object.getBoolean("archived");

  // ... but this is a client-only field, so it needs to be converted.
  final boolean isDeleted = object.getLong("is_deleted", 0L) == 1L;
  final long localID = object.getLong("_id", -1L);
  final ClientMetadata cm = new ClientMetadata(localID, clientLastModified, isDeleted, isArchived);

  // Remove things that aren't part of the spec.
  object.remove("last_modified");
  object.remove("guid");
  object.remove("client_last_modified");
  object.remove("is_deleted");

  // We never want to upload stored_on; for new items it'll be null (and cause Bug 1153358),
  // and for existing items it should never change.
  object.remove("stored_on");

  object.remove(ReadingListItems.CONTENT_STATUS);
  object.remove(ReadingListItems.SYNC_STATUS);
  object.remove(ReadingListItems.SYNC_CHANGE_FLAGS);
  object.remove(ReadingListItems.CLIENT_LAST_MODIFIED);

  return new ClientReadingListRecord(sm, cm, object);
}
 
開發者ID:jrconlin,項目名稱:mc_backup,代碼行數:57,代碼來源:ReadingListClientRecordFactory.java


注:本文中的org.mozilla.gecko.sync.ExtendedJSONObject.getBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。