/** * Checks whether the <code>Action</code> was performed on ("belongs to") the given item * * @param item the item to be compared to the item connected to the <code>Action</code> * @return <code>true</code> if the <code>Action</code> points to the given item, <code>false</code> else */ public boolean isBelongingToItem(ItemVO<I,T> item) { if (this.item == null) { if (item != null) { return false; } } else { return this.item.equals(item); } return true; }
@Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof UserAssoc)) return false; final UserAssoc userAssoc = (UserAssoc) o; if (assocValue != null ? !assocValue.equals(userAssoc.assocValue) : userAssoc.assocValue != null) return false; if (changeDate != null ? !changeDate.equals(userAssoc.changeDate) : userAssoc.changeDate != null) return false; if (id != null ? !id.equals(userAssoc.id) : userAssoc.id != null) return false; if (itemTo != null ? !itemTo.equals(userAssoc.itemTo) : userAssoc.itemTo != null) return false; if (sourceTypeId != null ? !sourceTypeId.equals(userAssoc.sourceTypeId) : userAssoc.sourceTypeId != null) return false; if (tenantId != null ? !tenantId.equals(userAssoc.tenantId) : userAssoc.tenantId != null) return false; if (userFrom != null ? !userFrom.equals(userAssoc.userFrom) : userAssoc.userFrom != null) return false; return true; }
@SuppressWarnings("unchecked") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final RankedItemVO<I,T> other = (RankedItemVO<I,T>) obj; if (actionType == null) { if (other.actionType != null) return false; } else if (!actionType.equals(other.actionType)) return false; if (count == null) { if (other.count != null) return false; } else if (!count.equals(other.count)) return false; if (item == null) { if (other.item != null) return false; } else if (!item.equals(other.item)) return false; if (rank == null) { if (other.rank != null) return false; } else if (!rank.equals(other.rank)) return false; return true; } }
@SuppressWarnings("unchecked") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final AssociatedItemVO<I,T> other = (AssociatedItemVO<I,T>) obj; if (assocType == null) { if (other.assocType != null) return false; } else if (!assocType.equals(other.assocType)) return false; if (assocValue == null) { if (other.assocValue != null) return false; } else if (!assocValue.equals(other.assocValue)) return false; if (item == null) { if (other.item != null) return false; } else if (!item.equals(other.item)) return false; if (itemAssocId == null) { if (other.itemAssocId != null) return false; } else if (!itemAssocId.equals(other.itemAssocId)) return false; return true; } }
@SuppressWarnings("unchecked") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ClusterVO other = (ClusterVO) obj; // two clusters are equal if their items are equal! return this.getItem().equals(other.getItem()); }
@SuppressWarnings("unchecked") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final RecommendedItemVO<I,T> other = (RecommendedItemVO<I,T>) obj; if (explanation == null) { if (other.explanation != null) return false; } else if (!explanation.equals(other.explanation)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (item == null) { if (other.item != null) return false; } else if (!item.equals(other.item)) return false; if (itemAssocId == null) { if (other.itemAssocId != null) return false; } else if (!itemAssocId.equals(other.itemAssocId)) return false; if (predictionValue == null) { if (other.predictionValue != null) return false; } else if (!predictionValue.equals(other.predictionValue)) return false; if (recommendationId == null) { if (other.recommendationId != null) return false; } else if (!recommendationId.equals(other.recommendationId)) return false; return true; }
@SuppressWarnings("unchecked") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final RatingVO<I,T> other = (RatingVO<I,T>) obj; if (count == null) { if (other.count != null) return false; } else if (!count.equals(other.count)) return false; if (item == null) { if (other.item != null) return false; } else if (!item.equals(other.item)) return false; if (lastActionTime == null) { if (other.lastActionTime != null) return false; } else if (!lastActionTime.equals(other.lastActionTime)) return false; if (ratingValue == null) { if (other.ratingValue != null) return false; } else if (!ratingValue.equals(other.ratingValue)) return false; if (sessionId == null) { if (other.sessionId != null) return false; } else if (!sessionId.equals(other.sessionId)) return false; if (user == null) { if (other.user != null) return false; } else if (!user.equals(other.user)) return false; return true; } }
public boolean didUserRateItem(final Integer userId, final ItemVO<Integer, Integer> item, final Integer actionTypeId) { if (actionTypeId != this.actionTypeId) return false; for (RatingVO<Integer, Integer> rating : ratings) { if (!rating.getUser().equals(userId)) continue; if (!rating.getItem().equals(item)) continue; return true; } return false; }
if (itemFrom == null) { if (other.itemFrom != null) return false; } else if (!itemFrom.equals(other.itemFrom)) return false; if (itemTo == null) { if (other.itemTo != null) return false; } else if (!itemTo.equals(other.itemTo)) return false; if (sourceInfo == null) { if (other.sourceInfo != null) return false;
if (item == null) { if (other.item != null) return false; } else if (!item.equals(other.item)) return false; if (numberOfFoundItems == null) { if (other.numberOfFoundItems != null) return false;
assert this.equals(that) : "compareTo(...) inconsistent with equals(...)";
int maxTries = 3; int tries = 0; while ((otherItem == null || otherItem.equals(item) || alreadyUsedOtherItems.contains(otherItem))) { otherItem = items.get((int)(Math.random() * items.size())); if (tries++ > maxTries) break INNER;