in applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java [3023:3114]
public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId,
String accommodationSpotId,
Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, Map<String,
String> orderItemAttributes, String prodCatalogId, BigDecimal selectedAmount,
ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo) {
if (this.productId == null || productId == null) {
// all non-product items are unique
return false;
}
if (!this.productId.equals(productId)) {
return false;
}
if ((this.prodCatalogId == null && prodCatalogId != null) || (this.prodCatalogId != null && prodCatalogId == null)) {
return false;
}
if (this.prodCatalogId != null && prodCatalogId != null && !this.prodCatalogId.equals(prodCatalogId)) {
return false;
}
if (selectedAmount != null && this.selectedAmount.compareTo(selectedAmount) != 0) {
return false;
}
if ((this.reservStart == null && reservStart != null) || (this.reservStart != null && reservStart == null)) {
return false;
}
if (this.reservStart != null && reservStart != null && !this.reservStart.equals(reservStart)) {
return false;
}
if (reservLength != null && this.reservLength.compareTo(reservLength) != 0) {
return false;
}
if (reservPersons != null && this.reservPersons.compareTo(reservPersons) != 0) {
return false;
}
if (this.accommodationMapId != null && !this.accommodationMapId.equals(accommodationMapId)) {
return false;
}
if (this.accommodationSpotId != null && !this.accommodationSpotId.equals(accommodationSpotId)) {
return false;
}
if (this.isPromo != isPromo) {
return false;
}
if ((this.additionalProductFeatureAndAppls == null && UtilValidate.isNotEmpty(additionalProductFeatureAndAppls))
|| (UtilValidate.isNotEmpty(this.additionalProductFeatureAndAppls) && additionalProductFeatureAndAppls == null)
|| (this.additionalProductFeatureAndAppls != null && additionalProductFeatureAndAppls != null
&& (this.additionalProductFeatureAndAppls.size() != additionalProductFeatureAndAppls.size()
|| !(this.additionalProductFeatureAndAppls.equals(additionalProductFeatureAndAppls))))) {
return false;
}
if ((this.attributes == null && UtilValidate.isNotEmpty(attributes)) || (UtilValidate.isNotEmpty(this.attributes) && attributes == null)
|| (this.attributes != null && attributes != null && (this.attributes.size() != attributes.size()
|| !(this.attributes.equals(attributes))))) {
return false;
}
if (configWrapper != null && !configWrapper.equals(this.configWrapper)) {
return false;
}
if (itemType != null && !itemType.equals(this.itemType)) {
return false;
}
if (itemGroup != null && !itemGroup.equals(this.itemGroup)) {
return false;
}
if (quoteId != null) {
// all items linked to a quote are unique
return false;
}
if (requirementId != null) {
// all items linked to a requirement are unique
return false;
}
// order item attribute unique
return !((this.orderItemAttributes == null && UtilValidate.isNotEmpty(orderItemAttributes))
|| (UtilValidate.isNotEmpty(this.orderItemAttributes) && orderItemAttributes == null)
|| (this.orderItemAttributes != null && orderItemAttributes != null && (this.orderItemAttributes.size() != orderItemAttributes.size()
|| !(this.orderItemAttributes.equals(orderItemAttributes)))));
}