From 7ecccc3ce01ca6203b357938ee1e77d5a0e5b384 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 10 May 2020 01:50:30 +0200 Subject: [PATCH] Continued: - renamed other to fooEntity - sorted members - added @SuppressWarning where really no "fix" is wanted MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jshopcore/model/order/ShopOrder.java | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/org/mxchange/jshopcore/model/order/ShopOrder.java b/src/org/mxchange/jshopcore/model/order/ShopOrder.java index 93f764b..6253243 100644 --- a/src/org/mxchange/jshopcore/model/order/ShopOrder.java +++ b/src/org/mxchange/jshopcore/model/order/ShopOrder.java @@ -97,31 +97,21 @@ public class ShopOrder implements Orderable { return false; } - final Orderable other = (Orderable) object; + final Orderable orderable = (Orderable) object; - if (!Objects.equals(this.getAccessKey(), other.getAccessKey())) { + if (!Objects.equals(this.getAccessKey(), orderable.getAccessKey())) { return false; - } else if (!Objects.equals(this.getCustomer(), other.getCustomer())) { + } else if (!Objects.equals(this.getCustomer(), orderable.getCustomer())) { return false; - } else if (!Objects.equals(this.getOrderId(), other.getOrderId())) { + } else if (!Objects.equals(this.getOrderId(), orderable.getOrderId())) { return false; - } else if (!Objects.equals(this.getOrderedItems(), other.getOrderedItems())) { + } else if (!Objects.equals(this.getOrderedItems(), orderable.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; @@ -143,11 +133,13 @@ public class ShopOrder implements Orderable { } @Override + @SuppressWarnings ("ReturnOfDateField") public Date getOrderCreated () { return this.orderCreated; } @Override + @SuppressWarnings ("AssignmentToDateFieldFromParameter") public void setOrderCreated (final Date orderCreated) { this.orderCreated = orderCreated; } @@ -163,13 +155,27 @@ public class ShopOrder implements Orderable { } @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List getOrderedItems () { return this.orderedItems; } @Override + @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") public void setOrderedItems (final List orderedItems) { this.orderedItems = orderedItems; } + @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; + } + } -- 2.39.5