@Test public void writeAndReadFromParcel() { Parcel parcel = Parcel.obtain(); response.writeToParcel(parcel, 0); parcel.setDataPosition(0); VehicleMessage createdFromParcel = VehicleMessage.CREATOR.createFromParcel(parcel); assertThat(createdFromParcel, instanceOf(CommandResponse.class)); assertEquals(response, createdFromParcel); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeSerializable(getCommand()); out.writeInt(getStatus() ? 1 : 0); out.writeString(getMessage()); }
CommandResponse extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeSerializable(getCommand()); out.writeInt(getStatus() ? 1 : 0); out.writeString(getMessage()); } }
CommandResponse extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeSerializable(getCommand()); out.writeInt(getStatus() ? 1 : 0); out.writeString(getMessage()); } CommandResponse(CommandType command, boolean status, String message);  CommandResponse(CommandType command, boolean status); protected  CommandResponse(Parcel in); protected  CommandResponse(); }
CommandResponse extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeSerializable(getCommand()); out.writeInt(getStatus() ? 1 : 0); out.writeString(getMessage()); } CommandResponse(CommandType command, boolean status, String message);  CommandResponse(CommandType command, boolean status); protected  CommandResponse(Parcel in); protected  CommandResponse(); boolean hasMessage(); String getMessage(); CommandType getCommand(); boolean getStatus(); @Override boolean equals(Object obj); @Override String toString(); @Override MessageKey getKey(); static boolean containsRequiredFields(Set<String> fields); @Override void writeToParcel(Parcel out, int flags); }
CommandResponse extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeSerializable(getCommand()); out.writeInt(getStatus() ? 1 : 0); out.writeString(getMessage()); } CommandResponse(CommandType command, boolean status, String message);  CommandResponse(CommandType command, boolean status); protected  CommandResponse(Parcel in); protected  CommandResponse(); boolean hasMessage(); String getMessage(); CommandType getCommand(); boolean getStatus(); @Override boolean equals(Object obj); @Override String toString(); @Override MessageKey getKey(); static boolean containsRequiredFields(Set<String> fields); @Override void writeToParcel(Parcel out, int flags);  }