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                    Class<?> clazz = getClass();
059    
060                    return clazz.getSimpleName();
061            }
062    
063            @Override
064            public Double getWeight() {
065                    return 10.0;
066            }
067    
068            @Override
069            public int hashCode() {
070                    return HashUtil.hash(0, getKey());
071            }
072    
073            /**
074             * @throws IOException
075             */
076            @Override
077            public void include(
078                            HttpServletRequest request, HttpServletResponse response)
079                    throws IOException {
080            }
081    
082            @Override
083            public boolean isEnabled() {
084                    return true;
085            }
086    
087            private static final String _DEFAUTL_ICON = "circle-blank";
088    
089    }