Last active
January 23, 2019 09:18
-
-
Save highsource/625818b7898dfe4f8ae6 to your computer and use it in GitHub Desktop.
Example of the equals(...) method generated by the JAXB2 SimpleEquals Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean equals(Object object) { | |
if (!(object instanceof PurchaseOrderType)) { | |
return false; | |
} | |
if (this == object) { | |
return true; | |
} | |
final PurchaseOrderType that = ((PurchaseOrderType) object); | |
{ | |
USAddress leftShipTo; | |
leftShipTo = this.getShipTo(); | |
USAddress rightShipTo; | |
rightShipTo = that.getShipTo(); | |
if (leftShipTo!= null) { | |
if (rightShipTo!= null) { | |
if (!leftShipTo.equals(rightShipTo)) { | |
return false; | |
} | |
} else { | |
return false; | |
} | |
} else { | |
if (rightShipTo!= null) { | |
return false; | |
} | |
} | |
} | |
{ | |
USAddress leftBillTo; | |
leftBillTo = this.getBillTo(); | |
USAddress rightBillTo; | |
rightBillTo = that.getBillTo(); | |
if (leftBillTo!= null) { | |
if (rightBillTo!= null) { | |
if (!leftBillTo.equals(rightBillTo)) { | |
return false; | |
} | |
} else { | |
return false; | |
} | |
} else { | |
if (rightBillTo!= null) { | |
return false; | |
} | |
} | |
} | |
{ | |
String leftComment; | |
leftComment = this.getComment(); | |
String rightComment; | |
rightComment = that.getComment(); | |
if (leftComment!= null) { | |
if (rightComment!= null) { | |
if (!leftComment.equals(rightComment)) { | |
return false; | |
} | |
} else { | |
return false; | |
} | |
} else { | |
if (rightComment!= null) { | |
return false; | |
} | |
} | |
} | |
{ | |
Items leftItems; | |
leftItems = this.getItems(); | |
Items rightItems; | |
rightItems = that.getItems(); | |
if (leftItems!= null) { | |
if (rightItems!= null) { | |
if (!leftItems.equals(rightItems)) { | |
return false; | |
} | |
} else { | |
return false; | |
} | |
} else { | |
if (rightItems!= null) { | |
return false; | |
} | |
} | |
} | |
{ | |
XMLGregorianCalendar leftOrderDate; | |
leftOrderDate = this.getOrderDate(); | |
XMLGregorianCalendar rightOrderDate; | |
rightOrderDate = that.getOrderDate(); | |
if (leftOrderDate!= null) { | |
if (rightOrderDate!= null) { | |
if (!leftOrderDate.equals(rightOrderDate)) { | |
return false; | |
} | |
} else { | |
return false; | |
} | |
} else { | |
if (rightOrderDate!= null) { | |
return false; | |
} | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why does it generate always blocks without if or try-catch?
The code complexity is unnecessary high, and the readability of it is also not the best by this!