@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BsonObjectId that = (BsonObjectId) o; if (!value.equals(that.value)) { return false; } return true; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof FatherEntity)) { return false; } final FatherEntity<?> that = (FatherEntity<?>) o; return id.equals(that.id) && embeddedList.equals(that.embeddedList); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof CompoundId)) { return false; } final CompoundId other = ((CompoundId) obj); return other.id.equals(id) && other.name.equals(name); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof CId)) { return false; } final CId other = ((CId) obj); return other.id.equals(id) && other.name.equals(name); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ListMapPerson)) { return false; } final ListMapPerson that = (ListMapPerson) o; if (id != null ? !id.equals(that.id) : that.id != null) { return false; } return list.equals(that.list); }
@Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final User other = (User) obj; return !(id != other.id && (id == null || !id.equals(other.id))); } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final WithNested that = (WithNested) o; if (id != null ? !id.equals(that.id) : that.id != null) { return false; } return nested != null ? nested.equals(that.nested) : that.nested == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Book book = (Book) o; if (id != null ? !id.equals(book.id) : book.id != null) { return false; } return name != null ? name.equals(book.name) : book.name == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Author author = (Author) o; if (id != null ? !id.equals(author.id) : author.id != null) { return false; } return name != null ? name.equals(author.name) : author.name == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof DocumentValidation)) { return false; } final DocumentValidation that = (DocumentValidation) o; if (number != that.number) { return false; } if (id != null ? !id.equals(that.id) : that.id != null) { return false; } if (string != null ? !string.equals(that.string) : that.string != null) { return false; } return date != null ? date.equals(that.date) : that.date == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final ReferenceKey that = (ReferenceKey) o; if (id != null ? !id.equals(that.id) : that.id != null) { return false; } if (name != null ? !name.equals(that.name) : that.name != null) { return false; } return true; } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final TestEntity that = (TestEntity) o; return id != null ? id.equals(that.id) : that.id == null && !(data != null ? !data.equals(that.data) : that.data != null); } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ParentType)) { return false; } final ParentType that = (ParentType) o; if (id != null ? !id.equals(that.id) : that.id != null) { return false; } return embedded != null ? embedded.equals(that.embedded) : that.embedded == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final AuditEntry<?> that = (AuditEntry<?>) o; if (id != null ? !id.equals(that.id) : that.id != null) { return false; } return delta.equals(that.delta); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final ChildEntity that = (ChildEntity) o; if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) { return false; } if (value != null ? !value.equals(that.value) : that.value != null) { return false; } return true; } }
@Test @SuppressWarnings("deprecation") public void testUpdateFirstNoCreateWithEntity() { List<EntityLogs> logs = new ArrayList<EntityLogs>(); for (int i = 0; i < 100; i++) { logs.add(createEntryLogs("name", "logs" + i)); } EntityLogs logs1 = logs.get(0); Query<EntityLogs> query = getDs().find(EntityLogs.class); BasicDBObject object = new BasicDBObject("new", "value"); EntityLogs newLogs = new EntityLogs(); newLogs.raw = object; getDs().updateFirst(query, newLogs, false); List<EntityLogs> list = toList(getDs().find(EntityLogs.class).find()); for (int i = 0; i < list.size(); i++) { final EntityLogs entityLogs = list.get(i); assertEquals(entityLogs.id.equals(logs1.id) ? object : logs.get(i).raw, entityLogs.raw); } }
@Test public void testUpdateFirstNoCreateWithWriteConcern() { List<EntityLogs> logs = new ArrayList<EntityLogs>(); for (int i = 0; i < 100; i++) { logs.add(createEntryLogs("name", "logs" + i)); } EntityLogs logs1 = logs.get(0); getDs().update(getDs().find(EntityLogs.class), getDs().createUpdateOperations(EntityLogs.class) .set("raw", new BasicDBObject("new", "value")), new UpdateOptions()); List<EntityLogs> list = toList(getDs().find(EntityLogs.class).find()); for (int i = 0; i < list.size(); i++) { final EntityLogs entityLogs = list.get(i); assertEquals(entityLogs.id.equals(logs1.id) ? new BasicDBObject("new", "value") : logs.get(i).raw, entityLogs.raw); } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Foo)) { return false; } final Foo foo = (Foo) o; if (getId() != null ? !getId().equals(foo.getId()) : foo.getId() != null) { return false; } return getNumber() != null ? getNumber().equals(foo.getNumber()) : foo.getNumber() == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Foo)) { return false; } final Foo foo = (Foo) o; if (getId() != null ? !getId().equals(foo.getId()) : foo.getId() != null) { return false; } return getCurrency() != null ? getCurrency().equals(foo.getCurrency()) : foo.getCurrency() == null; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof TestEntity)) { return false; } final TestEntity that = (TestEntity) o; if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) { return false; } return getData() != null ? getData().equals(that.getData()) : that.getData() == null; } }