Skip to content

Commit 5f781e6

Browse files
committed
generified PagedListHolded (SPR-6825)
1 parent 09998b2 commit 5f781e6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

org.springframework.beans/src/main/java/org/springframework/beans/support/PagedListHolder.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,14 +47,14 @@
4747
* @see #getPageList()
4848
* @see org.springframework.beans.support.MutableSortDefinition
4949
*/
50-
public class PagedListHolder implements Serializable {
50+
public class PagedListHolder<E> implements Serializable {
5151

5252
public static final int DEFAULT_PAGE_SIZE = 10;
5353

5454
public static final int DEFAULT_MAX_LINKED_PAGES = 10;
5555

5656

57-
private List source;
57+
private List<E> source;
5858

5959
private Date refreshDate;
6060

@@ -77,7 +77,7 @@ public class PagedListHolder implements Serializable {
7777
* @see #setSource
7878
*/
7979
public PagedListHolder() {
80-
this(new ArrayList(0));
80+
this(new ArrayList<E>(0));
8181
}
8282

8383
/**
@@ -86,7 +86,7 @@ public PagedListHolder() {
8686
* @param source the source List
8787
* @see MutableSortDefinition#setToggleAscendingOnProperty
8888
*/
89-
public PagedListHolder(List source) {
89+
public PagedListHolder(List<E> source) {
9090
this(source, new MutableSortDefinition(true));
9191
}
9292

@@ -95,7 +95,7 @@ public PagedListHolder(List source) {
9595
* @param source the source List
9696
* @param sort the SortDefinition to start with
9797
*/
98-
public PagedListHolder(List source, SortDefinition sort) {
98+
public PagedListHolder(List<E> source, SortDefinition sort) {
9999
setSource(source);
100100
setSort(sort);
101101
}
@@ -104,7 +104,7 @@ public PagedListHolder(List source, SortDefinition sort) {
104104
/**
105105
* Set the source list for this holder.
106106
*/
107-
public void setSource(List source) {
107+
public void setSource(List<E> source) {
108108
Assert.notNull(source, "Source List must not be null");
109109
this.source = source;
110110
this.refreshDate = new Date();
@@ -114,7 +114,7 @@ public void setSource(List source) {
114114
/**
115115
* Return the source list for this holder.
116116
*/
117-
public List getSource() {
117+
public List<E> getSource() {
118118
return this.source;
119119
}
120120

@@ -268,7 +268,7 @@ public int getLastElementOnPage() {
268268
/**
269269
* Return a sub-list representing the current page.
270270
*/
271-
public List getPageList() {
271+
public List<E> getPageList() {
272272
return getSource().subList(getFirstElementOnPage(), getLastElementOnPage() + 1);
273273
}
274274

@@ -325,7 +325,7 @@ protected SortDefinition copySortDefinition(SortDefinition sort) {
325325
* Can be overridden in subclasses.
326326
* @see PropertyComparator#sort(java.util.List, SortDefinition)
327327
*/
328-
protected void doSort(List source, SortDefinition sort) {
328+
protected void doSort(List<E> source, SortDefinition sort) {
329329
PropertyComparator.sort(source, sort);
330330
}
331331

0 commit comments

Comments
 (0)