public Builder(Device d) { mName = d.getName(); mManufacturer = d.getManufacturer(); for (Software s : d.getAllSoftware()) { mSoftware.add(s.deepCopy()); } for (State s : d.getAllStates()) { mState.add(s.deepCopy()); } mSoftware.addAll(d.getAllSoftware()); mState.addAll(d.getAllStates()); mMeta = d.getMeta(); mDefaultState = d.getDefaultState(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof Device)) { return false; } Device d = (Device) o; return mName.equals(d.getName()) && mManufacturer.equals(d.getManufacturer()) && mSoftware.equals(d.getAllSoftware()) && mState.equals(d.getAllStates()) && mMeta.equals(d.getMeta()) && mDefaultState.equals(d.getDefaultState()); }