Code example for Cache

Methods: getIfPresent

0
    } 
 
    private ControllerScriptImpl getOrCreate( final ResourceKey script )
    { 
        final String cacheKey = composeCacheKey( script );
        final ControllerScriptImpl controller = this.cache.getIfPresent( cacheKey );
        if ( controller != null )
        { 
            return controller;
        } 
 
        final ControllerScriptImpl created = createControllerScript( script );
        this.cache.put( cacheKey, created );
        return created;
    } 
 
    private ControllerScriptImpl createControllerScript( final ResourceKey script )
    { 
        final ScriptExports exports = this.scriptService.execute( script );
        return new ControllerScriptImpl( exports, this.postProcessor );
Contextual code suggestions in your IDE  Get Codota for Java