Example usage for org.springframework.security.core GrantedAuthority hashCode

List of usage examples for org.springframework.security.core GrantedAuthority hashCode

Introduction

In this page you can find the example usage for org.springframework.security.core GrantedAuthority hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:de.blizzy.documentr.web.filter.AuthenticationCreationTimeFilter.java

private int getHashCode(Authentication authentication) {
    int result = StringUtils.defaultString(authentication.getName()).hashCode();
    for (GrantedAuthority authority : authentication.getAuthorities()) {
        result ^= authority.hashCode();
    }/*from  w w w  .j  av a 2 s  .c om*/
    return result;
}