001    /**
002     * Copyright (c) 2000-present 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.portlet;
016    
017    import java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * @author Julio Camarero
022     */
023    public class PublicRenderParameters extends HashMap<String, String[]> {
024    
025            public PublicRenderParameters(
026                    Map<String, String[]> map1, Map<String, String[]> map2) {
027    
028                    super(map1);
029    
030                    _map = map2;
031            }
032    
033            @Override
034            public void clear() {
035                    super.clear();
036    
037                    if (_map != null) {
038                            _map.clear();
039                    }
040            }
041    
042            @Override
043            public String[] put(String key, String[] value) {
044                    if (_map != null) {
045                            _map.put(key, value);
046                    }
047    
048                    return super.put(key, value);
049            }
050    
051            @Override
052            public void putAll(Map<? extends String, ? extends String[]> map) {
053                    super.putAll(map);
054    
055                    if (_map != null) {
056                            _map.putAll(map);
057                    }
058            }
059    
060            @Override
061            public String[] remove(Object key) {
062                    if (_map != null) {
063                            _map.remove(key);
064                    }
065    
066                    return super.remove(key);
067            }
068    
069            private final Map<String, String[]> _map;
070    
071    }