]> git.mxchange.org Git - jshop-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 9 May 2020 23:50:30 +0000 (01:50 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 9 May 2020 23:51:36 +0000 (01:51 +0200)
- renamed other to fooEntity
- sorted members
- added @SuppressWarning where really no "fix" is wanted

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jshopcore/model/order/ShopOrder.java

index 93f764bb4d65dd445c52eb09bde147efc4ef5e54..6253243ecfe4fd7e3801183eca245364e6f833ae 100644 (file)
@@ -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<AddableBasketItem> getOrderedItems () {
                return this.orderedItems;
        }
 
        @Override
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
        public void setOrderedItems (final List<AddableBasketItem> 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;
+       }
+
 }