001    /**
002     * Copyright (c) 2000-2013 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.portlet.asset.model;
016    
017    import com.liferay.portal.kernel.json.JSON;
018    
019    import java.io.Serializable;
020    
021    import java.util.List;
022    
023    /**
024     * @author Igor Spasic
025     */
026    public class AssetTagDisplay implements Serializable {
027    
028            public AssetTagDisplay() {
029            }
030    
031            public AssetTagDisplay(List<AssetTag> tags, int total, int start, int end) {
032                    _tags = tags;
033                    _total = total;
034                    _start = start;
035                    _end = end;
036            }
037    
038            public int getEnd() {
039                    return _end;
040            }
041    
042            public int getPage() {
043                    if ((_end > 0) && (_start >= 0)) {
044                            return _end / (_end - _start);
045                    }
046    
047                    return 0;
048            }
049    
050            public int getStart() {
051                    return _start;
052            }
053    
054            public List<AssetTag> getTags() {
055                    return _tags;
056            }
057    
058            public int getTotal() {
059                    return _total;
060            }
061    
062            public void setEnd(int end) {
063                    _end = end;
064            }
065    
066            public void setStart(int start) {
067                    _start = start;
068            }
069    
070            public void setTags(List<AssetTag> tags) {
071                    _tags = tags;
072            }
073    
074            public void setTotal(int total) {
075                    _total = total;
076            }
077    
078            private int _end;
079            private int _start;
080    
081            @JSON
082            private List<AssetTag> _tags;
083    
084            private int _total;
085    
086    }