@Test public void testEquals() { CloudantToDo ctd = new CloudantToDo(td); assertFalse(ctd.equals(null)); assertFalse(ctd.equals("test")); CloudantToDo testCtd = new CloudantToDo(); testCtd.set_id("123"); testCtd.setTitle("This is a test"); assertTrue(ctd.equals(testCtd)); }
@Override public boolean equals(Object obj) { if(obj instanceof CloudantToDo) { CloudantToDo test = (CloudantToDo)obj; boolean result = _id == null ? _id == test.get_id() : _id.equals(test.get_id()); result &= _rev == null ? _rev == test.get_rev() : _rev.equals(test.get_rev()); result &= title == null ? title == test.getTitle() : title.equals(test.getTitle()); result &= completed == test.isCompleted(); result &= order == test.getOrder(); return result; } else { return false; } }
CloudantToDo { @Override public boolean equals(Object obj) { if(obj instanceof CloudantToDo) { CloudantToDo test = (CloudantToDo)obj; boolean result = _id == null ? _id == test.get_id() : _id.equals(test.get_id()); result &= _rev == null ? _rev == test.get_rev() : _rev.equals(test.get_rev()); result &= title == null ? title == test.getTitle() : title.equals(test.getTitle()); result &= completed == test.isCompleted(); result &= order == test.getOrder(); return result; } else { return false; } } }
CloudantToDo { @Override public boolean equals(Object obj) { if(obj instanceof CloudantToDo) { CloudantToDo test = (CloudantToDo)obj; boolean result = _id == null ? _id == test.get_id() : _id.equals(test.get_id()); result &= _rev == null ? _rev == test.get_rev() : _rev.equals(test.get_rev()); result &= title == null ? title == test.getTitle() : title.equals(test.getTitle()); result &= completed == test.isCompleted(); result &= order == test.getOrder(); return result; } else { return false; } } CloudantToDo();  CloudantToDo(ToDo td); }
CloudantToDo { @Override public boolean equals(Object obj) { if(obj instanceof CloudantToDo) { CloudantToDo test = (CloudantToDo)obj; boolean result = _id == null ? _id == test.get_id() : _id.equals(test.get_id()); result &= _rev == null ? _rev == test.get_rev() : _rev.equals(test.get_rev()); result &= title == null ? title == test.getTitle() : title.equals(test.getTitle()); result &= completed == test.isCompleted(); result &= order == test.getOrder(); return result; } else { return false; } } CloudantToDo();  CloudantToDo(ToDo td); String get_id(); void set_id(String _id); String get_rev(); void set_rev(String _rev); String getTitle(); void setTitle(String title); boolean isCompleted(); void setCompleted(boolean completed); ToDo getToDo(); int getOrder(); void setOrder(int order); @Override boolean equals(Object obj); @Override int hashCode(); }
CloudantToDo { @Override public boolean equals(Object obj) { if(obj instanceof CloudantToDo) { CloudantToDo test = (CloudantToDo)obj; boolean result = _id == null ? _id == test.get_id() : _id.equals(test.get_id()); result &= _rev == null ? _rev == test.get_rev() : _rev.equals(test.get_rev()); result &= title == null ? title == test.getTitle() : title.equals(test.getTitle()); result &= completed == test.isCompleted(); result &= order == test.getOrder(); return result; } else { return false; } } CloudantToDo();  CloudantToDo(ToDo td); String get_id(); void set_id(String _id); String get_rev(); void set_rev(String _rev); String getTitle(); void setTitle(String title); boolean isCompleted(); void setCompleted(boolean completed); ToDo getToDo(); int getOrder(); void setOrder(int order); @Override boolean equals(Object obj); @Override int hashCode();  }