bolts.Task.getResult()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中bolts.Task.getResult()方法的一些代码示例,展示了Task.getResult()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getResult()方法的具体详情如下:
包路径:bolts.Task
类名称:Task
方法名:getResult

Task.getResult介绍

暂无

代码示例

代码示例来源:origin: facebook/facebook-android-sdk

@Override
  public AppLink then(Task<Map<Uri, AppLink>> resolveUrisTask) throws Exception {
    return resolveUrisTask.getResult().get(uri);
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Void> then(Task<String> task) {
    String sessionToken = task.getResult();
    return deleteAllAsync(objects, sessionToken);
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Void then(Task<String> task) throws Exception {
    result.put("uuid", task.getResult());
    return null;
  }
}));

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Cursor> then(Task<String> task) {
    uuid.set(task.getResult());
    String[] args = {uuid.get()};
    return db.queryAsync(OfflineSQLiteOpenHelper.TABLE_OBJECTS, select, where, args);
  }
}).onSuccess(new Continuation<Cursor, String>() {

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<String> then(Task<String> task) {
    uuid.set(task.getResult());
    return task;
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<List<T>> then(Task<ParseUser> task) {
    final ParseUser user = task.getResult();
    return enqueueForAll(objects, new Continuation<Void, Task<List<T>>>() {
      @Override
      public Task<List<T>> then(Task<Void> task) {
        return fetchAllAsync(objects, user, onlyIfNeeded, task);
      }
    });
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Void> then(Task<String> task) {
    final String sessionToken = task.getResult();
    return taskQueue.enqueue(new Continuation<Void, Task<Void>>() {
      @Override
      public Task<Void> then(Task<Void> toAwait) {
        return deleteAsync(sessionToken, toAwait);
      }
    });
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Boolean then(Task<List<T>> task) throws ParseException {
    return matches(object, task.getResult());
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public T then(Task<List<T>> task) throws Exception {
    if (task.isFaulted()) {
      throw task.getError();
    }
    if (task.getResult() != null && task.getResult().size() > 0) {
      return task.getResult().get(0);
    }
    throw new ParseException(ParseException.OBJECT_NOT_FOUND, "no results found for query");
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public T then(Task<JSONObject> task) {
    @SuppressWarnings("unchecked")
    T result = (T) convertCloudResponse(task.getResult());
    return result;
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Integer> then(Task<ParsePin> task) {
    ParsePin pin = task.getResult();
    return findAsync(state, user, pin, true, db).onSuccess(new Continuation<List<T>, Integer>() {
      @Override
      public Integer then(Task<List<T>> task) {
        return task.getResult().size();
      }
    });
  }
});

代码示例来源:origin: facebook/facebook-android-sdk

@Suppress
public void testUrlWithNoAppLinkData() {
  String testNoAppLinkUrlString = "https://fb.me/732873156764191_no_app_link";
  Uri testNoAppLinkUrl = Uri.parse(testNoAppLinkUrlString);
  try {
    executeResolverOnBlockerThread(new FacebookAppLinkResolver(), testNoAppLinkUrl);
    getTestBlocker().waitForSignals(1);
    assertNotNull(resolveTask);
    Task<AppLink> singleUrlResolveTask = (Task<AppLink>)resolveTask;
    assertTrue(singleUrlResolveTask.isCompleted() &&
        !singleUrlResolveTask.isCancelled() &&
        !singleUrlResolveTask.isFaulted());
    AppLink appLink = singleUrlResolveTask.getResult();
    assertNull(appLink);
  } catch (Exception e) {
    // Forcing the test to fail with details
    assertNull(e);
  }
}

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Boolean> then(Task<Integer> task) {
    boolean exists = task.getResult() == 1;
    if (exists) {
      return Task.forResult(true);
    }
    return legacy.existsAsync();
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Void> then(Task<ParsePin> task) {
    if (task.isFaulted()) {
      return task.makeVoid();
    }
    ParsePin pin = task.getResult();
    return unpinAsync(pin, db);
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public String then(Task<ParseObject.State> task) {
    ParseObject.State result = task.getResult();
    return ParseObject.<ParseSession>from(result).getSessionToken();
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<Void> then(Task<String> task) {
    String sessionToken = task.getResult();
    return getAnalyticsController().trackEventInBackground(name, dimensionsCopy, sessionToken);
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public Task<ParseConfig> then(Task<JSONObject> task) {
    JSONObject result = task.getResult();
    final ParseConfig config = ParseConfig.decode(result, ParseDecoder.get());
    return currentConfigController.setCurrentConfigAsync(config).continueWith(new Continuation<Void, ParseConfig>() {
      @Override
      public ParseConfig then(Task<Void> task) {
        return config;
      }
    });
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public ParseObject.State then(Task<JSONObject> task) {
    JSONObject result = task.getResult();
    // Copy and clear to create an new empty instance of the same type as `state`
    ParseObject.State.Init<?> builder = state.newBuilder().clear();
    return coder.decode(builder, result, decoder)
        .isComplete(false)
        .build();
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public ParseObject.State then(Task<JSONObject> task) {
    JSONObject result = task.getResult();
    // Copy and clear to create an new empty instance of the same type as `state`
    ParseObject.State.Init<?> builder = state.newBuilder().clear();
    return coder.decode(builder, result, decoder)
        .isComplete(true)
        .build();
  }
});

代码示例来源:origin: parse-community/Parse-SDK-Android

@Override
  public ParseUser.State then(Task<JSONObject> task) {
    JSONObject result = task.getResult();
    return coder.decode(new ParseUser.State.Builder(), result, ParseDecoder.get())
        .isComplete(true)
        .isNew(command.getStatusCode() == STATUS_CODE_CREATED)
        .putAuthData(authType, authData)
        .build();
  }
});

相关文章