InstantRunBuildInfo { public int getFormat() { String attribute = mRoot.getAttribute(ATTR_FORMAT); if (Strings.isNullOrEmpty(attribute)) { return -1; } try { return Integer.parseInt(attribute); } catch (NumberFormatException nfe) { return -1; } } InstantRunBuildInfo(@NonNull String xml, @NonNull Element root); @NonNull String getTimeStamp(); long getSecretToken(); @NonNull String getVerifierStatus(); boolean canHotswap(); boolean hasNoChanges(); int getFeatureLevel(); @NonNull List<InstantRunArtifact> getArtifacts(); boolean hasOneOf(@NonNull InstantRunArtifactType... types); boolean hasMainApk(); @Nullable static InstantRunBuildInfo get(@NonNull String xml); boolean isCompatibleFormat(); int getFormat(); void serializeTo(@NonNull Writer writer); static final String ATTR_API_LEVEL; static final String VALUE_VERIFIER_STATUS_COMPATIBLE; }
@Test public void testFormat() throws IOException { InstantRunBuildInfo info = getBuildInfo("instantrun", "build-info1.xml"); assertEquals(1, info.getFormat()); }