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.kernel.servlet.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.HashUtil;
018    
019    import java.io.IOException;
020    
021    import javax.servlet.http.HttpServletRequest;
022    import javax.servlet.http.HttpServletResponse;
023    
024    /**
025     * @author Julio Camarero
026     */
027    public abstract class BaseAssetAddonEntry implements AssetAddonEntry {
028    
029            @Override
030            public boolean equals(Object obj) {
031                    if (this == obj) {
032                            return true;
033                    }
034    
035                    if (!(obj instanceof AssetAddonEntry)) {
036                            return false;
037                    }
038    
039                    AssetAddonEntry assetAddonEntry = (AssetAddonEntry)obj;
040    
041                    String key = assetAddonEntry.getKey();
042    
043                    if (getKey() == key) {
044                            return true;
045                    }
046                    else {
047                            return false;
048                    }
049            }
050    
051            @Override
052            public String getIcon() {
053                    return _DEFAUTL_ICON;
054            }
055    
056            @Override
057            public String getKey() {
058                    return getClass().getSimpleName();
059            }
060    
061            @Override
062            public Double getWeight() {
063                    return 10.0;
064            }
065    
066            @Override
067            public int hashCode() {
068                    return HashUtil.hash(0, getKey());
069            }
070    
071            /**
072             * @throws IOException
073             */
074            @Override
075            public void include(
076                            HttpServletRequest request, HttpServletResponse response)
077                    throws IOException {
078            }
079    
080            @Override
081            public boolean isEnabled() {
082                    return true;
083            }
084    
085            private static final String _DEFAUTL_ICON = "circle-blank";
086    
087    }