1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.dining.util;
16
17 import org.apache.commons.collections.Predicate;
18 import org.kuali.mobility.dining.entity.DiningHall;
19
20
21
22
23 public class DiningHallBuildingPredicate implements Predicate {
24 private String buildingName;
25
26 public DiningHallBuildingPredicate(String buildingName) {
27 super();
28 this.setBuildingName(buildingName);
29 }
30
31 @Override
32 public boolean evaluate( Object obj ) {
33 boolean match = false;
34 if( obj instanceof DiningHall ) {
35 if( getBuildingName() != null
36 && getBuildingName().equalsIgnoreCase( ((DiningHall)obj).getBuilding().getName() ) ) {
37 match = true;
38 }
39 }
40 return match;
41 }
42
43 public String getBuildingName() {
44 return buildingName;
45 }
46
47 public void setBuildingName(String buildingName) {
48 this.buildingName = buildingName;
49 }
50 }