protected String calcCacheKey(String key) {
        switch (keyMode) {
        case HASH:
        case MONOPOLISTIC:
            return key;
        case NAMESPACE:
            return getName() + ":" + key;
        default:
            throw new IllegalStateException("Invalid key mode: " + keyMode);
        }
    }
protected String calcCacheKey(String key) {
        switch (keyMode) {
        case HASH:
        case MONOPOLISTIC:
            return key;
        case NAMESPACE:
            return getName() + ":" + key;
        default:
            throw new IllegalStateException("Invalid key mode: " + keyMode);
        }
    }
protected String calcCacheKey ( String key ) { switch ( keyMode ) { case HASH : case MONOPOLISTIC : return key ; case NAMESPACE : return getName ( ) + ":" + key ; default : throw new IllegalStateException ( "Invalid key mode: " + keyMode ) ; } }
Calculates cache key based on the key mode.

<ul>
<li>HASH & MONOPOLISTIC mode: return the key as-is</li>
<li>NAMESPACE mode: return {@code cache_name:key}</li>
</ul>

@param key
@return
Calculates cache key based on the key mode .