Author: abelevich
Date: 2007-06-25 12:28:03 -0400 (Mon, 25 Jun 2007)
New Revision: 1300
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
Log:
override equals and hashCode methods
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-06-25
16:27:16 UTC (rev 1299)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-06-25
16:28:03 UTC (rev 1300)
@@ -10,6 +10,8 @@
package org.richfaces.model;
+import java.io.Serializable;
+
import org.ajax4jsf.ajax.repeat.Range;
@@ -18,8 +20,10 @@
* @author Maksim Kaszynski
* @modified by Anton Belevich
*/
-public class ScrollableGridRange implements Range{
+public class ScrollableGridRange implements Range, Serializable{
+ private static final long serialVersionUID = -6675002421400464892L;
+
private int first = 0;
private int last = 0;
private SortOrder sortOrder;
@@ -63,4 +67,27 @@
public void setSortOrder(SortOrder sortOrder) {
this.sortOrder = sortOrder;
}
+
+ public boolean equals(Object obj) {
+
+ if(!(obj instanceof ScrollableGridRange)){
+ return super.equals(obj);
+ }
+
+ ScrollableGridRange ref = (ScrollableGridRange)obj;
+
+ boolean ret = (this.first == ref.first)&&(this.last == ref.last );
+
+ if(this.sortOrder != null){
+ ret = ret && this.sortOrder.equals(ref.sortOrder);
+ } else {
+ ret = (ret && (ref.sortOrder == null));
+ }
+
+ return ret;
+ }
+
+ public int hashCode() {
+ return super.hashCode();
+ }
}
Show replies by date