1
1
/*
2
- * Copyright 2002-2008 the original author or authors.
2
+ * Copyright 2002-2010 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
47
47
* @see #getPageList()
48
48
* @see org.springframework.beans.support.MutableSortDefinition
49
49
*/
50
- public class PagedListHolder implements Serializable {
50
+ public class PagedListHolder < E > implements Serializable {
51
51
52
52
public static final int DEFAULT_PAGE_SIZE = 10 ;
53
53
54
54
public static final int DEFAULT_MAX_LINKED_PAGES = 10 ;
55
55
56
56
57
- private List source ;
57
+ private List < E > source ;
58
58
59
59
private Date refreshDate ;
60
60
@@ -77,7 +77,7 @@ public class PagedListHolder implements Serializable {
77
77
* @see #setSource
78
78
*/
79
79
public PagedListHolder () {
80
- this (new ArrayList (0 ));
80
+ this (new ArrayList < E > (0 ));
81
81
}
82
82
83
83
/**
@@ -86,7 +86,7 @@ public PagedListHolder() {
86
86
* @param source the source List
87
87
* @see MutableSortDefinition#setToggleAscendingOnProperty
88
88
*/
89
- public PagedListHolder (List source ) {
89
+ public PagedListHolder (List < E > source ) {
90
90
this (source , new MutableSortDefinition (true ));
91
91
}
92
92
@@ -95,7 +95,7 @@ public PagedListHolder(List source) {
95
95
* @param source the source List
96
96
* @param sort the SortDefinition to start with
97
97
*/
98
- public PagedListHolder (List source , SortDefinition sort ) {
98
+ public PagedListHolder (List < E > source , SortDefinition sort ) {
99
99
setSource (source );
100
100
setSort (sort );
101
101
}
@@ -104,7 +104,7 @@ public PagedListHolder(List source, SortDefinition sort) {
104
104
/**
105
105
* Set the source list for this holder.
106
106
*/
107
- public void setSource (List source ) {
107
+ public void setSource (List < E > source ) {
108
108
Assert .notNull (source , "Source List must not be null" );
109
109
this .source = source ;
110
110
this .refreshDate = new Date ();
@@ -114,7 +114,7 @@ public void setSource(List source) {
114
114
/**
115
115
* Return the source list for this holder.
116
116
*/
117
- public List getSource () {
117
+ public List < E > getSource () {
118
118
return this .source ;
119
119
}
120
120
@@ -268,7 +268,7 @@ public int getLastElementOnPage() {
268
268
/**
269
269
* Return a sub-list representing the current page.
270
270
*/
271
- public List getPageList () {
271
+ public List < E > getPageList () {
272
272
return getSource ().subList (getFirstElementOnPage (), getLastElementOnPage () + 1 );
273
273
}
274
274
@@ -325,7 +325,7 @@ protected SortDefinition copySortDefinition(SortDefinition sort) {
325
325
* Can be overridden in subclasses.
326
326
* @see PropertyComparator#sort(java.util.List, SortDefinition)
327
327
*/
328
- protected void doSort (List source , SortDefinition sort ) {
328
+ protected void doSort (List < E > source , SortDefinition sort ) {
329
329
PropertyComparator .sort (source , sort );
330
330
}
331
331
0 commit comments