@CheckForNull
    public UserDetails getCached(String idOrFullName) throws UsernameNotFoundException {
        Boolean exists = existenceCache.getIfPresent(idOrFullName);
        if (exists != null && !exists) {
            throw new UserMayOrMayNotExistException(String.format("\"%s\" does not exist", idOrFullName));
        } else {
            return detailsCache.getIfPresent(idOrFullName);
        }
    }
@ CheckForNull public UserDetails getCached ( String idOrFullName ) throws UsernameNotFoundException { Boolean exists = existenceCache . getIfPresent ( idOrFullName ) ; if ( exists != null && ! exists ) { throw new UserMayOrMayNotExistException ( String . format ( "\"%s\" does not exist" , idOrFullName ) ) ; } else { return detailsCache . getIfPresent ( idOrFullName ) ; } }
Gets the cached UserDetails for the given username.
Similar to {@link #loadUserByUsername(String)} except it doesn't perform the actual lookup if there is a cache miss.

@param idOrFullName the username

@return {@code null} if the cache doesn't contain any data for the key or the user details cached for the key.
@throws UsernameNotFoundException if a previous lookup resulted in the same