001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.cache.key;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    
019    import java.io.Serializable;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class CacheKeyGeneratorWrapper implements CacheKeyGenerator {
025    
026            public CacheKeyGeneratorWrapper(CacheKeyGenerator cacheKeyGenerator) {
027                    _cacheKeyGenerator = cacheKeyGenerator;
028            }
029    
030            public CacheKeyGenerator append(String key) {
031                    return _cacheKeyGenerator.append(key);
032            }
033    
034            public CacheKeyGenerator append(String[] keys) {
035                    return _cacheKeyGenerator.append(keys);
036            }
037    
038            public CacheKeyGenerator append(StringBundler sb) {
039                    return _cacheKeyGenerator.append(sb);
040            }
041    
042            @Override
043            public CacheKeyGenerator clone() {
044                    return new CacheKeyGeneratorWrapper(_cacheKeyGenerator.clone());
045            }
046    
047            public Serializable finish() {
048                    return _cacheKeyGenerator.finish();
049            }
050    
051            public Serializable getCacheKey(String key) {
052                    return _cacheKeyGenerator.getCacheKey(key);
053            }
054    
055            public Serializable getCacheKey(String[] keys) {
056                    return _cacheKeyGenerator.getCacheKey(keys);
057            }
058    
059            public Serializable getCacheKey(StringBundler sb) {
060                    return _cacheKeyGenerator.getCacheKey(sb);
061            }
062    
063            public boolean isCallingGetCacheKeyThreadSafe() {
064                    return _cacheKeyGenerator.isCallingGetCacheKeyThreadSafe();
065            }
066    
067            private CacheKeyGenerator _cacheKeyGenerator;
068    
069    }