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