java.security.Principal.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(107)

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

Principal.hashCode介绍

[英]Returns the hash code value for this Principal. Returns the same hash code for Principals that are equal to each other as required by the general contract of Object#hashCode.
[中]返回此主体的哈希代码值。根据Object#hashCode的一般约定,为彼此相等的主体返回相同的哈希代码。

代码示例

代码示例来源:origin: spring-projects/spring-security

@Override
public int hashCode() {
  return 31 ^ principal.hashCode() ^ role.hashCode();
}

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

/**
 * Get the hash code of this principal.
 *
 * @return the hash code of this principal
 */
public int hashCode() {
  return r.hashCode() * 17 + p.hashCode();
}

代码示例来源:origin: org.springframework.security/spring-security-core

@Override
public int hashCode() {
  return 31 ^ principal.hashCode() ^ role.hashCode();
}

代码示例来源:origin: org.switchyard/switchyard-security

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((_principal == null) ? 0 : _principal.hashCode());
  result = prime * result + (_trusted ? 1231 : 1237);
  return result;
}

代码示例来源:origin: com.caucho/resin

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

代码示例来源:origin: org.apache.knox/gateway-server

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

代码示例来源:origin: jboss-switchyard/core

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((_principal == null) ? 0 : _principal.hashCode());
  result = prime * result + (_trusted ? 1231 : 1237);
  return result;
}

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

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

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public int hashCode() {
  return subject.hashCode() + issuer.hashCode();
}

代码示例来源:origin: org.apache.qpid/qpid-broker-core

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

代码示例来源:origin: org.apache.jspwiki/jspwiki-main

/**
 *  The hashcode is based on the hashcode of the wrapped principal.
 *  
 *  @return A hashcode.
 */
@Override
public int hashCode()
{
  return m_principal.hashCode() * 13;
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
 * Get the hash code of this principal.
 *
 * @return the hash code of this principal
 */
public int hashCode() {
  return r.hashCode() * 17 + p.hashCode();
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-auth

/**
 * Get the hash code of this principal.
 *
 * @return the hash code of this principal
 */
public int hashCode() {
  return r.hashCode() * 17 + p.hashCode();
}

代码示例来源:origin: com.github.nyla-solutions/nyla.solutions.core

@Override
public int hashCode()
{
  final int prime = 31;
  int result = 1;
  result = prime * result + ((permissions == null) ? 0 : permissions.hashCode());
  result = prime * result + ((principal == null) ? 0 : principal.hashCode());
  return result;
}

代码示例来源:origin: org.apache.tomee/tomee-catalina

public int hashCode() {
    int result;
    result = realm.hashCode();
    result = 31 * result + tomcatPrincipal.hashCode();
    return result;
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Get the hash code of this principal.
 *
 * @return the hash code of this principal
 */
public int hashCode() {
  return r.hashCode() * 17 + p.hashCode();
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public int hashCode() {
  return 31 ^ principal.hashCode() ^ role.hashCode();
}

代码示例来源:origin: org.picketbox/picketbox

public int hashCode()
{
  int hashCode = 0;
  if( cs != null )
    hashCode = cs.hashCode();
  int length = (this.principals == null ? 0 : this.principals.length);
  for(int p = 0; p < length; p ++)
  {
    hashCode += this.principals[p].hashCode();
  }
  return hashCode;
}

代码示例来源:origin: org.glassfish.main.security/security-ee

public int hashCode() {
if (customPrincipal == null) {
  return super.hashCode();
} 
return customPrincipal.hashCode();
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void testHashCode() {
  assertTrue(everyone.hashCode() == EveryonePrincipal.getInstance().hashCode());
}

相关文章

微信公众号

最新文章

更多