Esempio n. 1
0
  @Test
  public void hashCodeShouldNotBeEqual() {

    Category category1 = new Category("john", "desc", true, false);
    Category category2 = new Category("bob", "desc", true, false);

    assertNotSame(category1.hashCode(), category2.hashCode());
  }
Esempio n. 2
0
 public int hashCode() {
   int code = 17;
   code += object.hashCode();
   code *= 37;
   code += category.hashCode();
   code *= 37;
   return code;
 }
 public int hashCode() {
   int result;
   result = username.hashCode();
   result = 29 * result + dateAdded.hashCode();
   result = 29 * result + item.hashCode();
   result = 29 * result + category.hashCode();
   return result;
 }
Esempio n. 4
0
 @Override
 public int hashCode() {
   int result = uuid != null ? uuid.hashCode() : 0;
   result = 31 * result + (type != null ? type.hashCode() : 0);
   result = 31 * result + (name != null ? name.hashCode() : 0);
   result = 31 * result + (ip != null ? ip.hashCode() : 0);
   result = 31 * result + (mac != null ? mac.hashCode() : 0);
   result = 31 * result + (category != null ? category.hashCode() : 0);
   return result;
 }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((actors == null) ? 0 : actors.hashCode());
   result = prime * result + ((category == null) ? 0 : category.hashCode());
   result = prime * result + ((description == null) ? 0 : description.hashCode());
   result = prime * result + ((languages == null) ? 0 : languages.hashCode());
   result = prime * result + ((rating == null) ? 0 : rating.hashCode());
   result = prime * result + release_year;
   result = prime * result + ((title == null) ? 0 : title.hashCode());
   return result;
 }