当前位置: 首页>>代码示例>>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;未经允许,请勿转载。