@Override public boolean equals(Object obj) { if (!super.equals(obj) || !(obj instanceof DiagnosticResponse)) { return false; } final DiagnosticResponse other = (DiagnosticResponse) obj; return Objects.equal(mValue, other.mValue) && Objects.equal(mNegativeResponseCode, other.mNegativeResponseCode); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(getBusId()); out.writeInt(getId()); out.writeInt(getMode()); out.writeValue(getPid()); if(getPayload() != null) { out.writeInt(getPayload().length); out.writeByteArray(getPayload()); } else { out.writeInt(0); } }
@Override public boolean equals(Object obj) { if(!super.equals(obj) || getClass() != obj.getClass()) { return false; } final DiagnosticMessage other = (DiagnosticMessage) obj; return mBusId == other.mBusId && mId == other.mId && mMode == other.mMode && ((!hasPid() && !other.hasPid()) || mPid.equals(other.mPid)) && Arrays.equals(mPayload, other.mPayload); }
@Override public MessageKey getKey() { if(super.getKey() == null) { HashMap<String, Object> key = new HashMap<>(); key.put(CanMessage.BUS_KEY, getBusId()); key.put(CanMessage.ID_KEY, getId()); key.put(MODE_KEY, getMode()); key.put(PID_KEY, getPid()); setKey(new MessageKey(key)); } return super.getKey(); }
@Override protected void readFromParcel(Parcel in) { super.readFromParcel(in); mMultipleResponses = (Boolean) in.readValue(Boolean.class.getClassLoader()); mFrequency = (Double) in.readValue(Double.class.getClassLoader()); mName = in.readString(); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(mMultipleResponses); out.writeValue(getFrequency()); out.writeString(getName()); }
@Override protected void readFromParcel(Parcel in) { super.readFromParcel(in); mValue = (Double) in.readValue(Double.class.getClassLoader()); mNegativeResponseCode = (NegativeResponseCode) in.readSerializable(); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); out.writeSerializable(getNegativeResponseCode()); }
@Override public boolean equals(Object obj) { if(!super.equals(obj) || !(obj instanceof DiagnosticRequest)) { return false; } final DiagnosticRequest other = (DiagnosticRequest) obj; return getMultipleResponses() == other.getMultipleResponses() && Objects.equal(mFrequency, other.mFrequency) && Objects.equal(mName, other.mName); }