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.HtmlUtil;
018    import com.liferay.portal.model.BaseModel;
019    
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * @author Sergio Gonz??lez
025     */
026    public class BreadcrumbEntry {
027    
028            public BaseModel<?> getBaseModel() {
029                    return _baseModel;
030            }
031    
032            public Map<String, Object> getData() {
033                    return _data;
034            }
035    
036            public Object getData(String key) {
037                    return _data.get(key);
038            }
039    
040            public String getTitle() {
041                    return HtmlUtil.escape(_title);
042            }
043    
044            public String getURL() {
045                    return _url;
046            }
047    
048            public void putData(String key, Object value) {
049                    if (_data == null) {
050                            _data = new HashMap<>();
051                    }
052    
053                    _data.put(key, value);
054            }
055    
056            public void setBaseModel(BaseModel<?> baseModel) {
057                    _baseModel = baseModel;
058            }
059    
060            public void setData(Map<String, Object> data) {
061                    _data = data;
062            }
063    
064            public void setTitle(String title) {
065                    _title = title;
066            }
067    
068            public void setURL(String url) {
069                    _url = url;
070            }
071    
072            private BaseModel<?> _baseModel;
073            private Map<String, Object> _data;
074            private String _title;
075            private String _url;
076    
077    }