本文整理匯總了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);
}
}
示例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");
}
}
}
}
}
示例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();
}
}
};
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}