@Test public void testWriteToParcel() { List<WarningImpl> warnings = createWarningList(); ShortDynamicLinkImpl shortDynamicLink = new ShortDynamicLinkImpl(shortLink, previewLink, warnings); Parcel out = Parcel.obtain(); shortDynamicLink.writeToParcel(out, 0); out.setDataPosition(0); ShortDynamicLinkImpl parcelLink = ShortDynamicLinkImpl.CREATOR.createFromParcel(out); assertEquals(shortDynamicLink.getShortLink(), parcelLink.getShortLink()); assertEquals(shortDynamicLink.getPreviewLink(), parcelLink.getPreviewLink()); List<WarningImpl> parcelWarnings = parcelLink.getWarnings(); assertEquals(warnings.size(), parcelWarnings.size()); for (int i = 0; i < warnings.size(); ++i) { WarningImpl warning = warnings.get(i); WarningImpl parcelWarning = parcelWarnings.get(i); assertEquals(warning.getCode(), parcelWarning.getCode()); assertEquals(warning.getMessage(), parcelWarning.getMessage()); } }
@Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); }
ShortDynamicLinkImpl extends AbstractSafeParcelable implements ShortDynamicLink { @Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); } }
ShortDynamicLinkImpl extends AbstractSafeParcelable implements ShortDynamicLink { @Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); } @SafeParcelable.Constructor  ShortDynamicLinkImpl(
      @Param(id = 1) Uri shortLink,
      @Param(id = 2) Uri previewLink,
      @Param(id = 3) List<WarningImpl> warnings); }
ShortDynamicLinkImpl extends AbstractSafeParcelable implements ShortDynamicLink { @Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); } @SafeParcelable.Constructor  ShortDynamicLinkImpl(
      @Param(id = 1) Uri shortLink,
      @Param(id = 2) Uri previewLink,
      @Param(id = 3) List<WarningImpl> warnings); @Override Uri getShortLink(); @Override Uri getPreviewLink(); @Override List<WarningImpl> getWarnings(); @Override void writeToParcel(Parcel dest, int flags); }
ShortDynamicLinkImpl extends AbstractSafeParcelable implements ShortDynamicLink { @Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); } @SafeParcelable.Constructor  ShortDynamicLinkImpl(
      @Param(id = 1) Uri shortLink,
      @Param(id = 2) Uri previewLink,
      @Param(id = 3) List<WarningImpl> warnings); @Override Uri getShortLink(); @Override Uri getPreviewLink(); @Override List<WarningImpl> getWarnings(); @Override void writeToParcel(Parcel dest, int flags); static final Creator<ShortDynamicLinkImpl> CREATOR; }