public boolean invokeBooleanMethod(String name) throws InvocationException { Boolean result = invokeMethod(name, Boolean.class); if (result == null) { throw new InvocationException("Unable to invoke method '%s' on class '%s': null returned", name, cls); } return result; }
/** * Returns <code>true</code> is the app is running in a debug mode */ public static boolean isAppDebuggable(Context context) { return getApplicationInfo(context).isDebuggable(); }
public IndentPrinter print(String format, Object... args) { String message = indentBuffer + StringUtils.format(format, args); printInternal(message); return this; }
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') exists", fieldName, first); } },
@Override public void writeExternal(DataOutput out) throws IOException { writeNullableUTF(out, id); writeNullableDouble(out, clientCreatedAt); writeNullableUTF(out, nonce); writeNullableUTF(out, state); writeNullableBoolean(out, isRead); writeNullableUTF(out, json); }
public static Invocation fromClass(String name) throws InvocationException { if (name == null) { throw new IllegalArgumentException("Class name is null"); } Class<?> cls = RuntimeUtils.classForName(name); if (cls == null) { throw new InvocationException("Unable to find class '%s'", name); } return fromClass(cls); }
/** * Constructs and returns a string object that is the result of interposing a separator between the elements of the list */ public static <T> String join(List<T> list) { return join(list, ","); }
public static String getAppVersionName(Context context) { return getApplicationInfo(context).getVersionName(); }
public static int getAppVersionCode(Context context) { return getApplicationInfo(context).getVersionCode(); }
/** * @return true if Apptimize SDK is integrated with the host app. */ public static boolean isApptimizeSDKAvailable() { return RuntimeUtils.classExists(CLASS_APPTIMIZE); }
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') not equal to '%s'", fieldName, first, second); } },
/** * Constructs and returns a string object that is the result of interposing a separator between the elements of the array */ public static <T> String join(T[] array) { return join(array, ","); }
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') equal to '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') is greater than or equal to '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') contains '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') ends with '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s (%s) less than %s", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') is less than or equal to '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') greater than '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') starts with '%s'", fieldName, first, second); } },