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


Java Utility.areObjectsEqual方法代碼示例

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


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

示例1: setCurrentAccessToken

import com.facebook.internal.Utility; //導入方法依賴的package包/類
private void setCurrentAccessToken(AccessToken currentAccessToken, boolean saveToCache) {
    AccessToken oldAccessToken = this.currentAccessToken;
    this.currentAccessToken = currentAccessToken;
    tokenRefreshInProgress.set(false);
    this.lastAttemptedTokenExtendDate = new Date(0);

    if (saveToCache) {
        if (currentAccessToken != null) {
            accessTokenCache.save(currentAccessToken);
        } else {
            accessTokenCache.clear();
            Utility.clearFacebookCookies(FacebookSdk.getApplicationContext());
        }
    }

    if (!Utility.areObjectsEqual(oldAccessToken, currentAccessToken)) {
        sendCurrentAccessTokenChangedBroadcast(oldAccessToken, currentAccessToken);
    }
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:20,代碼來源:AccessTokenManager.java

示例2: processSuccess

import com.facebook.internal.Utility; //導入方法依賴的package包/類
@Override
protected void processSuccess(GraphResponse response) {
    JSONArray dataSet = Utility.tryGetJSONArrayFromResponse(
            response.getJSONObject(),
            "data");
    if (dataSet != null) {
        for (int i = 0; i < dataSet.length(); i++) {
            JSONObject data = dataSet.optJSONObject(i);
            if (data != null) {
                objectIsLiked = true;
                JSONObject appData = data.optJSONObject("application");
                AccessToken accessToken = AccessToken.getCurrentAccessToken();
                if (appData != null &&
                        accessToken != null &&
                        Utility.areObjectsEqual(
                                accessToken.getApplicationId(),
                                appData.optString("id"))) {
                    unlikeToken = data.optString("id");
                }
            }
        }
    }
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:24,代碼來源:LikeActionController.java

示例3: registerAccessTokenTracker

import com.facebook.internal.Utility; //導入方法依賴的package包/類
private static void registerAccessTokenTracker() {
    accessTokenTracker = new AccessTokenTracker() {
        @Override
        protected void onCurrentAccessTokenChanged(
                AccessToken oldAccessToken,
                AccessToken currentAccessToken) {
            if (oldAccessToken == null) {
                // If we never had an access token, then there would be no pending uploads.
                return;
            }

            if (currentAccessToken == null ||
                    !Utility.areObjectsEqual(
                            currentAccessToken.getUserId(),
                            oldAccessToken.getUserId())) {
                // Cancel any pending uploads since the user changed.
                cancelAllRequests();
            }
        }
    };
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:22,代碼來源:VideoUploader.java

示例4: handleSuccess

import com.facebook.internal.Utility; //導入方法依賴的package包/類
@Override
protected void handleSuccess(JSONObject jsonObject)
        throws JSONException {
    String startOffset = jsonObject.getString(PARAM_START_OFFSET);
    String endOffset = jsonObject.getString(PARAM_END_OFFSET);

    if (Utility.areObjectsEqual(startOffset, endOffset)) {
        enqueueUploadFinish(
                uploadContext,
                0);
    } else {
        enqueueUploadChunk(
                uploadContext,
                startOffset,
                endOffset,
                0);
    }
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:19,代碼來源:VideoUploader.java

示例5: setCurrentProfile

import com.facebook.internal.Utility; //導入方法依賴的package包/類
private void setCurrentProfile(Profile currentProfile, boolean writeToCache) {
    Profile oldProfile = this.currentProfile;
    this.currentProfile = currentProfile;

    if (writeToCache) {
        if (currentProfile != null) {
            profileCache.save(currentProfile);
        } else {
            profileCache.clear();
        }
    }

    if (!Utility.areObjectsEqual(oldProfile, currentProfile)) {
        sendCurrentProfileChangedBroadcast(oldProfile, currentProfile);
    }
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:17,代碼來源:ProfileManager.java

示例6: equals

import com.facebook.internal.Utility; //導入方法依賴的package包/類
@Override
public boolean equals(Object o) {
    if (!(o instanceof AccessTokenAppIdPair)) {
        return false;
    }
    AccessTokenAppIdPair p = (AccessTokenAppIdPair) o;
    return Utility.areObjectsEqual(p.accessTokenString, accessTokenString) &&
            Utility.areObjectsEqual(p.applicationId, applicationId);
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:10,代碼來源:AppEventsLogger.java

示例7: updateState

import com.facebook.internal.Utility; //導入方法依賴的package包/類
private void updateState(boolean isObjectLiked,
                         String likeCountStringWithLike,
                         String likeCountStringWithoutLike,
                         String socialSentenceWithLike,
                         String socialSentenceWithoutLike,
                         String unlikeToken) {
    // Normalize all empty strings to null, so that we don't have any problems with comparison.
    likeCountStringWithLike = Utility.coerceValueIfNullOrEmpty(likeCountStringWithLike, null);
    likeCountStringWithoutLike =
            Utility.coerceValueIfNullOrEmpty(likeCountStringWithoutLike, null);
    socialSentenceWithLike = Utility.coerceValueIfNullOrEmpty(socialSentenceWithLike, null);
    socialSentenceWithoutLike =
            Utility.coerceValueIfNullOrEmpty(socialSentenceWithoutLike, null);
    unlikeToken = Utility.coerceValueIfNullOrEmpty(unlikeToken, null);

    boolean stateChanged = isObjectLiked != this.isObjectLiked ||
            !Utility.areObjectsEqual(
                    likeCountStringWithLike,
                    this.likeCountStringWithLike) ||
            !Utility.areObjectsEqual(
                    likeCountStringWithoutLike,
                    this.likeCountStringWithoutLike) ||
            !Utility.areObjectsEqual(socialSentenceWithLike, this.socialSentenceWithLike) ||
            !Utility.areObjectsEqual(
                    socialSentenceWithoutLike,
                    this.socialSentenceWithoutLike) ||
            !Utility.areObjectsEqual(unlikeToken, this.unlikeToken);

    if (!stateChanged) {
        return;
    }

    this.isObjectLiked = isObjectLiked;
    this.likeCountStringWithLike = likeCountStringWithLike;
    this.likeCountStringWithoutLike = likeCountStringWithoutLike;
    this.socialSentenceWithLike = socialSentenceWithLike;
    this.socialSentenceWithoutLike = socialSentenceWithoutLike;
    this.unlikeToken = unlikeToken;

    serializeToDiskAsync(this);

    broadcastAction(this, ACTION_LIKE_ACTION_CONTROLLER_UPDATED);
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:44,代碼來源:LikeActionController.java

示例8: getChunk

import com.facebook.internal.Utility; //導入方法依賴的package包/類
private static byte[] getChunk(
        UploadContext uploadContext,
        String chunkStart,
        String chunkEnd)
        throws IOException {
    if (!Utility.areObjectsEqual(chunkStart, uploadContext.chunkStart)) {
        // Something went wrong in the book-keeping here.
        logError(
                null,
                "Error reading video chunk. Expected chunk '%s'. Requested chunk '%s'.",
                uploadContext.chunkStart,
                chunkStart);
        return null;
    }

    long chunkStartLong = Long.parseLong(chunkStart);
    long chunkEndLong = Long.parseLong(chunkEnd);
    int chunkSize = (int) (chunkEndLong - chunkStartLong);

    ByteArrayOutputStream byteBufferStream = new ByteArrayOutputStream();
    int bufferSize = Math.min(8192, chunkSize);
    byte[] buffer = new byte[bufferSize];

    int len = 0;
    while ((len = uploadContext.videoStream.read(buffer)) != -1) {
        byteBufferStream.write(buffer, 0, len);

        chunkSize -= len;
        if (chunkSize == 0) {
            // Done!
            break;
        } else if (chunkSize < 0) {
            // This should not happen. Signal an error.
            logError(
                    null,
                    "Error reading video chunk. Expected buffer length - '%d'. Actual - '%d'.",
                    chunkSize + len,
                    len);
            return null;
        }
    }

    uploadContext.chunkStart = chunkEnd;

    return byteBufferStream.toByteArray();
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:47,代碼來源:VideoUploader.java


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