@Test public void writeAndReadFromParcel() { Parcel parcel = Parcel.obtain(); message.writeToParcel(parcel, 0); parcel.setDataPosition(0); VehicleMessage createdFromParcel = VehicleMessage.CREATOR.createFromParcel(parcel); assertThat(createdFromParcel, instanceOf(SimpleVehicleMessage.class)); assertEquals(message, createdFromParcel); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); }
SimpleVehicleMessage extends NamedVehicleMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); } }
SimpleVehicleMessage extends NamedVehicleMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); } SimpleVehicleMessage(Long timestamp, String name, Object value);  SimpleVehicleMessage(String name, Object value); protected  SimpleVehicleMessage(Parcel in); protected  SimpleVehicleMessage(); }
SimpleVehicleMessage extends NamedVehicleMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); } SimpleVehicleMessage(Long timestamp, String name, Object value);  SimpleVehicleMessage(String name, Object value); protected  SimpleVehicleMessage(Parcel in); protected  SimpleVehicleMessage(); Object getValue(); Number getValueAsNumber(); String getValueAsString(); Boolean getValueAsBoolean(); static boolean containsRequiredFields(Set<String> fields); @Override boolean equals(Object obj); @Override String toString(); @Override void writeToParcel(Parcel out, int flags); @Override void readFromParcel(Parcel in); }
SimpleVehicleMessage extends NamedVehicleMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); } SimpleVehicleMessage(Long timestamp, String name, Object value);  SimpleVehicleMessage(String name, Object value); protected  SimpleVehicleMessage(Parcel in); protected  SimpleVehicleMessage(); Object getValue(); Number getValueAsNumber(); String getValueAsString(); Boolean getValueAsBoolean(); static boolean containsRequiredFields(Set<String> fields); @Override boolean equals(Object obj); @Override String toString(); @Override void writeToParcel(Parcel out, int flags); @Override void readFromParcel(Parcel in);  }