| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
package org.apache.tapestry5.grid; |
| 16 | |
|
| 17 | |
import org.apache.tapestry5.beaneditor.PropertyModel; |
| 18 | |
import org.apache.tapestry5.ioc.internal.util.Defense; |
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
public class SortConstraint |
| 24 | |
{ |
| 25 | |
private final PropertyModel propertyModel; |
| 26 | |
|
| 27 | |
private final ColumnSort columnSort; |
| 28 | |
|
| 29 | |
public SortConstraint(PropertyModel propertyModel, ColumnSort columnSort) |
| 30 | 42 | { |
| 31 | 42 | Defense.notNull(propertyModel, "propertyModel"); |
| 32 | 42 | Defense.notNull(columnSort, "columnSort"); |
| 33 | |
|
| 34 | 42 | this.propertyModel = propertyModel; |
| 35 | 42 | this.columnSort = columnSort; |
| 36 | 42 | } |
| 37 | |
|
| 38 | |
public PropertyModel getPropertyModel() |
| 39 | |
{ |
| 40 | 34 | return propertyModel; |
| 41 | |
} |
| 42 | |
|
| 43 | |
public ColumnSort getColumnSort() |
| 44 | |
{ |
| 45 | 34 | return columnSort; |
| 46 | |
} |
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
@Override |
| 51 | |
public boolean equals(Object o) |
| 52 | |
{ |
| 53 | 0 | if (this == o) return true; |
| 54 | |
|
| 55 | 0 | if (o == null || getClass() != o.getClass()) return false; |
| 56 | |
|
| 57 | 0 | SortConstraint that = (SortConstraint) o; |
| 58 | |
|
| 59 | 0 | if (columnSort != that.columnSort) return false; |
| 60 | |
|
| 61 | 0 | return propertyModel.equals(that.propertyModel); |
| 62 | |
} |
| 63 | |
} |