// Deligate call to frontend
return this.deque.isEmpty();
}
+
}
* @param item Item instance to add
* <p>
* @throws org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException
- * If the item instance has already been added
+ * If
+ * the
+ * item
+ * instance
+ * has
+ * already
+ * been
+ * added
*/
void addItem (final T item) throws BasketItemAlreadyAddedException;
* @return Whether the basket is empty
*/
boolean isEmpty ();
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+
}
import org.mxchange.jshopcore.model.product.Product;
/**
- * An item (addedable to a basket) could respresent a product or a discount
- * coupon. This depends on the type of the item.
+ * An item (addable to a basket) could represent a product or a discount coupon.
+ * This depends on the type of the item.
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
* @param title the title to set
*/
void setCategoryTitle (final String title);
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+
}
*/
package org.mxchange.jshopcore.model.category;
+import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
/**
* Constructor which accepts all database fields
* <p>
- * @param categoryId Id number of database record
- * @param categoryTitle Category categoryTitle
+ * @param categoryId Id number of database record
+ * @param categoryTitle Category categoryTitle
* @param parentCategory Parent category
*/
public ProductCategory (final Long categoryId, final String categoryTitle, final Category parentCategory) {
this.setCategoryTitle(category.getCategoryTitle());
}
+ @Override
+ public boolean equals (final Object object) {
+ if (this == object) {
+ return true;
+ } else if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final Category other = (Category) object;
+
+ if (!Objects.equals(this.getCategoryTitle(), other.getCategoryTitle())) {
+ return false;
+ } else if (!Objects.equals(this.getCategoryId(), other.getCategoryId())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+ hash = 13 * hash + Objects.hashCode(this.getCategoryId());
+ hash = 13 * hash + Objects.hashCode(this.getCategoryTitle());
+ return hash;
+ }
+
@Override
public Long getCategoryId () {
return this.categoryId;
public void setParentCategory (final Category parentCategory) {
this.parentCategory = parentCategory;
}
+
}
* @param orderedItems List of ordered items
*/
void setOrderedItems (final List<AddableBasketItem> orderedItems);
+
+ @Override
+ boolean equals (final Object object);
+
+ @Override
+ int hashCode ();
+
}
import java.util.Calendar;
import java.util.List;
+import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@Transient
private List<AddableBasketItem> orderedItems;
+ @Override
+ public boolean equals (final Object object) {
+ if (this == object) {
+ return true;
+ } else if (null == object) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final Orderable other = (Orderable) object;
+
+ if (!Objects.equals(this.getAccessKey(), other.getAccessKey())) {
+ return false;
+ } else if (!Objects.equals(this.getCustomer(), other.getCustomer())) {
+ return false;
+ } else if (!Objects.equals(this.getOrderId(), other.getOrderId())) {
+ return false;
+ } else if (!Objects.equals(this.getOrderedItems(), other.getOrderedItems())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode () {
+ int hash = 7;
+ hash = 61 * hash + Objects.hashCode(this.getAccessKey());
+ hash = 61 * hash + Objects.hashCode(this.getCustomer());
+ hash = 61 * hash + Objects.hashCode(this.getOrderId());
+ hash = 61 * hash + Objects.hashCode(this.getOrderedItems());
+ return hash;
+ }
+
@Override
public String getAccessKey () {
return this.accessKey;
public void setOrderedItems (final List<AddableBasketItem> orderedItems) {
this.orderedItems = orderedItems;
}
+
}
public void setProductTitle (final String productTitle) {
this.productTitle = productTitle;
}
+
}
@Override
int hashCode ();
+
}