001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.cache.key;
016    
017    import com.liferay.portal.kernel.cache.key.CacheKeyGenerator;
018    import com.liferay.portal.kernel.util.StringBundler;
019    
020    /**
021     * @author Shuyang Zhou
022     */
023    public class SimpleCacheKeyGenerator extends BaseCacheKeyGenerator {
024    
025            @Override
026            public CacheKeyGenerator clone() {
027                    return new SimpleCacheKeyGenerator();
028            }
029    
030            public String getCacheKey(String key) {
031                    return key;
032            }
033    
034            public String getCacheKey(String[] keys) {
035                    StringBundler sb = new StringBundler(keys);
036    
037                    return sb.toString();
038            }
039    
040            public String getCacheKey(StringBundler sb) {
041                    return sb.toString();
042            }
043    
044    }