I remember eclipse and idea have this template to automatically create an object\'s hashCode based on its attributes.
One of the strategies if a number and a string is u
Use the Apache Commons HashcodeBuilder:
public int hashCode() {
new HashCodeBuilder(17, 37).
append(myString).
append(myInt);
}
Link here: http://commons.apache.org/lang/api-2.3/org/apache/commons/lang/builder/HashCodeBuilder.html
And here:
http://www.koders.com/java/fidCE4E86F23847AE93909CE105394B668DDB0F491A.aspx