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.portal.security.permission;
016    
017    import com.liferay.portal.kernel.security.permission.ModelResourceActionsBag;
018    
019    import java.util.HashMap;
020    import java.util.HashSet;
021    import java.util.Map;
022    import java.util.Set;
023    
024    /**
025     * @author László Csontos
026     */
027    public class ModelResourceActionsBagImpl
028            extends ResourceActionsBagImpl implements ModelResourceActionsBag {
029    
030            public ModelResourceActionsBagImpl() {
031            }
032    
033            public ModelResourceActionsBagImpl(
034                    ModelResourceActionsBag modelResourceActionsBag) {
035    
036                    super(modelResourceActionsBag);
037    
038                    _resourceOwnerDefaultActions.addAll(
039                            modelResourceActionsBag.getResourceOwnerDefaultActions());
040                    _resourceWeights.putAll(modelResourceActionsBag.getResourceWeights());
041            }
042    
043            @Override
044            public ModelResourceActionsBag clone() {
045                    return new ModelResourceActionsBagImpl(this);
046            }
047    
048            @Override
049            public Set<String> getResourceOwnerDefaultActions() {
050                    return _resourceOwnerDefaultActions;
051            }
052    
053            @Override
054            public Map<String, Double> getResourceWeights() {
055                    return _resourceWeights;
056            }
057    
058            private final Set<String> _resourceOwnerDefaultActions = new HashSet<>();
059            private final Map<String, Double> _resourceWeights = new HashMap<>();
060    
061    }