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 AssetVocabularyDisplay implements Serializable {
027    
028            public AssetVocabularyDisplay() {
029            }
030    
031            public AssetVocabularyDisplay(
032                    List<AssetVocabulary> vocabularies, int total, int start, int end) {
033    
034                    _vocabularies = vocabularies;
035                    _total = total;
036                    _start = start;
037                    _end = end;
038            }
039    
040            public int getEnd() {
041                    return _end;
042            }
043    
044            public int getPage() {
045                    if ((_end > 0) && (_start >= 0)) {
046                            return _end / (_end - _start);
047                    }
048    
049                    return 0;
050            }
051    
052            public int getStart() {
053                    return _start;
054            }
055    
056            public int getTotal() {
057                    return _total;
058            }
059    
060            public List<AssetVocabulary> getVocabularies() {
061                    return _vocabularies;
062            }
063    
064            public void setEnd(int end) {
065                    _end = end;
066            }
067    
068            public void setStart(int start) {
069                    _start = start;
070            }
071    
072            public void setTotal(int total) {
073                    _total = total;
074            }
075    
076            public void setVocabularies(List<AssetVocabulary> vocabularies) {
077                    _vocabularies = vocabularies;
078            }
079    
080            private int _end;
081            private int _start;
082            private int _total;
083    
084            @JSON
085            private List<AssetVocabulary> _vocabularies;
086    
087    }