本文整理了Java中com.facebook.internal.Validate.notNull()
方法的一些代码示例,展示了Validate.notNull()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Validate.notNull()
方法的具体详情如下:
包路径:com.facebook.internal.Validate
类名称:Validate
方法名:notNull
暂无
代码示例来源:origin: facebook/facebook-android-sdk
protected FacebookDialogBase(final Activity activity, int requestCode) {
Validate.notNull(activity, "activity");
this.activity = activity;
this.fragmentWrapper = null;
this.requestCode = requestCode;
}
代码示例来源:origin: facebook/facebook-android-sdk
public Builder(Context context, Uri imageUri) {
Validate.notNull(imageUri, "imageUri");
this.context = context;
this.imageUrl = imageUri;
}
代码示例来源:origin: facebook/facebook-android-sdk
ProfileManager(
LocalBroadcastManager localBroadcastManager,
ProfileCache profileCache) {
Validate.notNull(localBroadcastManager, "localBroadcastManager");
Validate.notNull(profileCache, "profileCache");
this.localBroadcastManager = localBroadcastManager;
this.profileCache = profileCache;
}
代码示例来源:origin: facebook/facebook-android-sdk
/**
* Sets the Executor used by the SDK for non-AsyncTask background work.
*
* @param executor
* the Executor to use; must not be null.
*/
public static void setExecutor(Executor executor) {
Validate.notNull(executor, "executor");
synchronized (LOCK) {
FacebookSdk.executor = executor;
}
}
代码示例来源:origin: facebook/facebook-android-sdk
AccessTokenManager(LocalBroadcastManager localBroadcastManager,
AccessTokenCache accessTokenCache) {
Validate.notNull(localBroadcastManager, "localBroadcastManager");
Validate.notNull(accessTokenCache, "accessTokenCache");
this.localBroadcastManager = localBroadcastManager;
this.accessTokenCache = accessTokenCache;
}
代码示例来源:origin: facebook/facebook-android-sdk
Result(
Request request,
Code code,
AccessToken token,
String errorMessage,
String errorCode) {
Validate.notNull(code, "code");
this.request = request;
this.token = token;
this.errorMessage = errorMessage;
this.code = code;
this.errorCode = errorCode;
}
代码示例来源:origin: facebook/facebook-android-sdk
public static void putToken(Bundle bundle, String value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
bundle.putString(TOKEN_KEY, value);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static long getLastRefreshMilliseconds(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return bundle.getLong(LAST_REFRESH_DATE_KEY);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static void putExpirationDate(Bundle bundle, Date value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
putDate(bundle, EXPIRATION_DATE_KEY, value);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static Attachment createAttachment(UUID callId, Bitmap attachmentBitmap) {
Validate.notNull(callId, "callId");
Validate.notNull(attachmentBitmap, "attachmentBitmap");
return new Attachment(callId, attachmentBitmap, null);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static Attachment createAttachment(UUID callId, Uri attachmentUri) {
Validate.notNull(callId, "callId");
Validate.notNull(attachmentUri, "attachmentUri");
return new Attachment(callId, null, attachmentUri);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static void putLastRefreshDate(Bundle bundle, Date value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
putDate(bundle, LAST_REFRESH_DATE_KEY, value);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static void putPermissions(Bundle bundle, Collection<String> value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
bundle.putStringArrayList(PERMISSIONS_KEY, new ArrayList<String>(value));
}
代码示例来源:origin: facebook/facebook-android-sdk
public static AccessTokenSource getSource(Bundle bundle) {
Validate.notNull(bundle, "bundle");
if (bundle.containsKey(TOKEN_SOURCE_KEY)) {
return (AccessTokenSource) bundle.getSerializable(TOKEN_SOURCE_KEY);
} else {
boolean isSSO = bundle.getBoolean(IS_SSO_KEY);
return isSSO ? AccessTokenSource.FACEBOOK_APPLICATION_WEB : AccessTokenSource.WEB_VIEW;
}
}
代码示例来源:origin: facebook/facebook-android-sdk
public static void putDeclinedPermissions(Bundle bundle, Collection<String> value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
bundle.putStringArrayList(DECLINED_PERMISSIONS_KEY, new ArrayList<String>(value));
}
代码示例来源:origin: facebook/facebook-android-sdk
public LegacyTokenHelper(Context context, String cacheKey) {
Validate.notNull(context, "context");
this.cacheKey = Utility.isNullOrEmpty(cacheKey) ? DEFAULT_CACHE_KEY : cacheKey;
// If the application context is available, use that. However, if it isn't
// available (possibly because of a context that was created manually), use
// the passed in context directly.
Context applicationContext = context.getApplicationContext();
context = applicationContext != null ? applicationContext : context;
this.cache = context.getSharedPreferences(
this.cacheKey,
Context.MODE_PRIVATE);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static Set<String> getPermissions(Bundle bundle) {
Validate.notNull(bundle, "bundle");
ArrayList<String> arrayList = bundle.getStringArrayList(PERMISSIONS_KEY);
if (arrayList == null) {
return null;
}
return new HashSet<String>(arrayList);
}
代码示例来源:origin: facebook/facebook-android-sdk
public static void hasInternetPermissions(Context context, boolean shouldThrow) {
Validate.notNull(context, "context");
if (context.checkCallingOrSelfPermission(Manifest.permission.INTERNET) ==
PackageManager.PERMISSION_DENIED) {
if (shouldThrow) {
throw new IllegalStateException(NO_INTERNET_PERMISSION_REASON);
} else {
Log.w(TAG, NO_INTERNET_PERMISSION_REASON);
}
}
}
代码示例来源:origin: facebook/facebook-android-sdk
void save(Profile profile) {
Validate.notNull(profile, "profile");
JSONObject jsonObject = profile.toJSONObject();
if (jsonObject != null) {
sharedPreferences
.edit()
.putString(CACHED_PROFILE_KEY, jsonObject.toString())
.apply();
}
}
代码示例来源:origin: facebook/facebook-android-sdk
public void save(AccessToken accessToken) {
Validate.notNull(accessToken, "accessToken");
JSONObject jsonObject = null;
try {
jsonObject = accessToken.toJSONObject();
sharedPreferences.edit().putString(CACHED_ACCESS_TOKEN_KEY, jsonObject.toString())
.apply();
} catch (JSONException e) {
// Can't recover
}
}
内容来源于网络,如有侵权,请联系作者删除!