javax.naming.Reference.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(105)

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

Reference.hashCode介绍

暂无

代码示例

代码示例来源:origin: com.addc/addc-base

/**
 * @see java.lang.Object#hashCode()
 */
@Override
public int hashCode() {
  final int prime= 31;
  int result= super.hashCode();
  result= prime * result + initialContextFactory.hashCode();
  result= prime * result + (loginRequired ? 1231 : 1237);
  result= prime * result + providerURL.hashCode();
  return result;
}

代码示例来源:origin: org.fusesource.fabric.bridge/fabric-bridge

@Override
public int hashCode() {
  int val = 0;
  val += (brokerUrl != null) ? brokerUrl.hashCode() : 0;
  val += maxConnections;
  val += (userName != null) ? userName.hashCode() : 0;
  val += (password != null) ? password.hashCode() : 0;
  val += (clientId != null) ? clientId.hashCode() : 0;
  val += (connectionFactoryRef != null) ? connectionFactoryRef.hashCode() : 0;
  val += (destinationResolverRef != null) ? destinationResolverRef.hashCode() : 0;
  if (connectionFactory != null) {
    try {
      val += ((Referenceable)connectionFactory).getReference().hashCode();
    } catch (NamingException e) {
      throw new IllegalArgumentException("Could not get Reference from ConnectionFactory: "
              + e.getMessage(), e);
    }
  }
  return val;
}

相关文章