java.lang.Short.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中java.lang.Short.hashCode()方法的一些代码示例,展示了Short.hashCode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Short.hashCode()方法的具体详情如下:
包路径:java.lang.Short
类名称:Short
方法名:hashCode

Short.hashCode介绍

[英]Returns a hash code for this Short; equal to the result of invoking intValue().
[中]返回此短消息的哈希代码;等于调用intValue()的结果。

代码示例

代码示例来源:origin: vavr-io/vavr

/**
 * Returns the hashcode of the given value.
 *
 * @param value the value to hash
 * @return the hashcode
 * @see Short#hashCode()
 */
static int hash(short value) {
  return Short.hashCode(value);
}

代码示例来源:origin: google/guava

@Override
public int hashCode() {
 return i.hashCode();
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Short.hashCode(getStoreId());
    hash = 31 * hash + Short.hashCode(getManagerStaffId());
    hash = 31 * hash + Integer.hashCode(getAddressId());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: apache/mahout

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + Short.valueOf(x).hashCode();
 return result;
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Short.hashCode(getLanguageId());
    hash = 31 * hash + Objects.hashCode(getName());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Short.hashCode(getCategoryId());
    hash = 31 * hash + Objects.hashCode(getName());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Integer.hashCode(getFilmId());
    hash = 31 * hash + Short.hashCode(getCategoryId());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Integer.hashCode(getInventoryId());
    hash = 31 * hash + Integer.hashCode(getFilmId());
    hash = 31 * hash + Short.hashCode(getStoreId());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: google/guava

public void testHashCode() {
 for (short value : VALUES) {
  assertEquals(((Short) value).hashCode(), Shorts.hashCode(value));
 }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Short.hashCode(getFilmId());
    hash = 31 * hash + Objects.hashCode(getTitle());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getDescription()));
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Integer.hashCode(getRentalId());
    hash = 31 * hash + Objects.hashCode(getRentalDate());
    hash = 31 * hash + Integer.hashCode(getInventoryId());
    hash = 31 * hash + Integer.hashCode(getCustomerId());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getReturnDate()));
    hash = 31 * hash + Short.hashCode(getStaffId());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Integer.hashCode(getPaymentId());
    hash = 31 * hash + Integer.hashCode(getCustomerId());
    hash = 31 * hash + Short.hashCode(getStaffId());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getRentalId()));
    hash = 31 * hash + Objects.hashCode(getAmount());
    hash = 31 * hash + Objects.hashCode(getPaymentDate());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Integer.hashCode(getCustomerId());
    hash = 31 * hash + Short.hashCode(getStoreId());
    hash = 31 * hash + Objects.hashCode(getFirstName());
    hash = 31 * hash + Objects.hashCode(getLastName());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getEmail()));
    hash = 31 * hash + Integer.hashCode(getAddressId());
    hash = 31 * hash + Integer.hashCode(getActive());
    hash = 31 * hash + Objects.hashCode(getCreateDate());
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Short.hashCode(getStaffId());
    hash = 31 * hash + Objects.hashCode(getFirstName());
    hash = 31 * hash + Objects.hashCode(getLastName());
    hash = 31 * hash + Integer.hashCode(getAddressId());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getPicture()));
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getEmail()));
    hash = 31 * hash + Short.hashCode(getStoreId());
    hash = 31 * hash + Objects.hashCode(getActive());
    hash = 31 * hash + Objects.hashCode(getUsername());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getPassword()));
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: speedment/speedment

@Override
  public int hashCode() {
    int hash = 7;
    hash = 31 * hash + Integer.hashCode(getFilmId());
    hash = 31 * hash + Objects.hashCode(getTitle());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getDescription()));
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getReleaseYear()));
    hash = 31 * hash + Short.hashCode(getLanguageId());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getOriginalLanguageId()));
    hash = 31 * hash + Short.hashCode(getRentalDuration());
    hash = 31 * hash + Objects.hashCode(getRentalRate());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getLength()));
    hash = 31 * hash + Objects.hashCode(getReplacementCost());
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getRating()));
    hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getSpecialFeatures()));
    hash = 31 * hash + Objects.hashCode(getLastUpdate());
    return hash;
  }
}

代码示例来源:origin: linlinjava/litemall

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table litemall_order_goods
 *
 * @mbg.generated
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
  result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
  result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
  result = prime * result + ((getGoodsSn() == null) ? 0 : getGoodsSn().hashCode());
  result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
  result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
  result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
  result = prime * result + (Arrays.hashCode(getSpecifications()));
  result = prime * result + ((getPicUrl() == null) ? 0 : getPicUrl().hashCode());
  result = prime * result + ((getComment() == null) ? 0 : getComment().hashCode());
  result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
  result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
  result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
  return result;
}

代码示例来源:origin: linlinjava/litemall

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table litemall_cart
 *
 * @mbg.generated
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
  result = prime * result + ((getGoodsSn() == null) ? 0 : getGoodsSn().hashCode());
  result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
  result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
  result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
  result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
  result = prime * result + (Arrays.hashCode(getSpecifications()));
  result = prime * result + ((getChecked() == null) ? 0 : getChecked().hashCode());
  result = prime * result + ((getPicUrl() == null) ? 0 : getPicUrl().hashCode());
  result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
  result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
  result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
  return result;
}

代码示例来源:origin: linlinjava/litemall

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table litemall_comment
 *
 * @mbg.generated
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  result = prime * result + ((getValueId() == null) ? 0 : getValueId().hashCode());
  result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
  result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
  result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  result = prime * result + ((getHasPicture() == null) ? 0 : getHasPicture().hashCode());
  result = prime * result + (Arrays.hashCode(getPicUrls()));
  result = prime * result + ((getStar() == null) ? 0 : getStar().hashCode());
  result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
  result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
  result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
  return result;
}

代码示例来源:origin: linlinjava/litemall

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table litemall_coupon_user
 *
 * @mbg.generated
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
  result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  result = prime * result + ((getUsedTime() == null) ? 0 : getUsedTime().hashCode());
  result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
  result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
  result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
  result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
  result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
  result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
  return result;
}

代码示例来源:origin: org.apache.commons/commons-lang3

@Test
public void testHashCode() {
  final MutableShort mutNumA = new MutableShort((short) 0);
  final MutableShort mutNumB = new MutableShort((short) 0);
  final MutableShort mutNumC = new MutableShort((short) 1);
  assertTrue(mutNumA.hashCode() == mutNumA.hashCode());
  assertTrue(mutNumA.hashCode() == mutNumB.hashCode());
  assertFalse(mutNumA.hashCode() == mutNumC.hashCode());
  assertTrue(mutNumA.hashCode() == Short.valueOf((short) 0).hashCode());
}

相关文章