View Javadoc
1   /*
2    * Copyright (C) 2003-2014 eXo Platform SAS.
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU Affero General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU Affero General Public License for more details.
13   *
14   * You should have received a copy of the GNU Affero General Public License
15   * along with this program. If not, see <http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.calendar.ws.bean;
18  
19  import java.io.Serializable;
20  import java.util.Collection;
21  
22  public class CollectionResource<T> implements Serializable {
23    /**
24     * 
25     */
26    private static final long serialVersionUID = 8125671009576049265L;
27    private int offset = 0;
28    private int limit = 0;
29    private long fullSize = -1;
30    
31    private Collection<T> data ;
32  
33    public CollectionResource(Collection<T> data) {
34      this.data = data;
35    }
36  
37    public CollectionResource(Collection<T> data, long fullSize){
38      this.data = data ;
39      this.fullSize = fullSize;
40    }
41  
42    public int getLimit() {
43      return limit;
44    }
45  
46    public void setLimit(int limit) {
47      this.limit = limit;
48    }
49  
50    public int getOffset() {
51      return offset;
52    }
53  
54    public void setOffset(int offset) {
55      this.offset = offset;
56    }
57  
58    public void setData(Collection<T> data) {
59      this.data = data;
60    }
61  
62    public Collection<T> getData() {
63      return data;
64    }
65  
66    public long getSize() {
67      return fullSize;
68    }
69  
70    public void setSize(long fullSize) {
71      this.fullSize = fullSize;
72    }
73  }