public final class Utility extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Utility.FetchedAppSettings |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_STREAM_BUFFER_SIZE |
Constructor and Description |
---|
Utility() |
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
areObjectsEqual(T a,
T b) |
static <T> ArrayList<T> |
arrayList(T... ts) |
static <T> List<T> |
asListNoNulls(T... array) |
static Uri |
buildUri(String authority,
String path,
Bundle parameters) |
static void |
clearCaches(Context context) |
static void |
clearFacebookCookies(Context context) |
static void |
closeQuietly(Closeable closeable) |
static void |
deleteDirectory(File directoryOrFile) |
static void |
disconnectQuietly(URLConnection connection) |
static String |
getActivityName(Context context)
Returns the name of the current activity if the context is an activity, otherwise return "unknown"
|
static String |
getHashedDeviceAndAppID(Context context,
String applicationId) |
static String |
getMetadataApplicationId(Context context) |
static Method |
getMethodQuietly(Class<?> clazz,
String methodName,
Class<?>... parameterTypes) |
static Method |
getMethodQuietly(String className,
String methodName,
Class<?>... parameterTypes) |
static Object |
getStringPropertyAsJSON(JSONObject jsonObject,
String key,
String nonJSONPropertyKey) |
static Object |
invokeMethodQuietly(Object receiver,
Method method,
Object... args) |
static <T> boolean |
isNullOrEmpty(Collection<T> c) |
static boolean |
isNullOrEmpty(String s) |
static <T> boolean |
isSubset(Collection<T> subset,
Collection<T> superset) |
static void |
logd(String tag,
Exception e) |
static void |
logd(String tag,
String msg) |
static void |
putObjectInBundle(Bundle bundle,
String key,
Object value) |
static Utility.FetchedAppSettings |
queryAppSettings(String applicationId,
boolean forceRequery) |
static String |
readStreamToString(InputStream inputStream) |
static void |
setAppEventAttributionParameters(GraphObject params,
AttributionIdentifiers attributionIdentifiers,
String hashedDeviceAndAppId,
boolean limitEventUsage) |
static void |
setAppEventExtendedDeviceInfoParameters(GraphObject params,
Context appContext) |
static boolean |
stringsEqualOrEmpty(String a,
String b) |
static <T> Collection<T> |
unmodifiableCollection(T... ts) |
public static final int DEFAULT_STREAM_BUFFER_SIZE
public static <T> boolean isSubset(Collection<T> subset, Collection<T> superset)
public static <T> boolean isNullOrEmpty(Collection<T> c)
public static boolean isNullOrEmpty(String s)
public static <T> Collection<T> unmodifiableCollection(T... ts)
public static <T> ArrayList<T> arrayList(T... ts)
public static void closeQuietly(Closeable closeable)
public static void disconnectQuietly(URLConnection connection)
public static Object getStringPropertyAsJSON(JSONObject jsonObject, String key, String nonJSONPropertyKey) throws JSONException
JSONException
public static String readStreamToString(InputStream inputStream) throws IOException
IOException
public static void clearFacebookCookies(Context context)
public static <T> boolean areObjectsEqual(T a, T b)
public static Utility.FetchedAppSettings queryAppSettings(String applicationId, boolean forceRequery)
public static void clearCaches(Context context)
public static void deleteDirectory(File directoryOrFile)
public static <T> List<T> asListNoNulls(T... array)
public static String getHashedDeviceAndAppID(Context context, String applicationId)
public static void setAppEventAttributionParameters(GraphObject params, AttributionIdentifiers attributionIdentifiers, String hashedDeviceAndAppId, boolean limitEventUsage)
public static void setAppEventExtendedDeviceInfoParameters(GraphObject params, Context appContext)
public static Method getMethodQuietly(Class<?> clazz, String methodName, Class<?>... parameterTypes)
public static Method getMethodQuietly(String className, String methodName, Class<?>... parameterTypes)
public static Object invokeMethodQuietly(Object receiver, Method method, Object... args)