@SuppressWarnings( "unchecked" ) @Override public final void persist( @Nonnull T instance, Object identifier, Map<String, Object> parameters, Locale locale ) { checkNotNull( instance ); checkNotNull( identifier ); Object key = composeKey( identifier, locale ); cache.put( key, instance ); logger.info( "The " + instance.getClass().getSimpleName() + " has cached with key: " + key ); }
@SuppressWarnings( "unchecked" ) @Override public final T get( Object identifier, Map<String, Object> parameters, Locale locale, Date lastModifiedDate ) { checkNotNull( identifier ); String key = composeKey( identifier, locale ); if ( !cache.containsKey( key ) ) { return null; } return ( T ) cache.get( key ); }