1 package org.tigris.scarab.reports; 2 3 41 42 import org.apache.fulcrum.intake.Retrievable; 43 import org.apache.commons.lang.ObjectUtils; 44 import org.tigris.scarab.util.Log; 45 46 51 public class ReportUserAttribute 52 implements java.io.Serializable , 53 Retrievable 54 { 55 private Integer attributeId; 56 57 private Integer userId; 58 59 private String queryKey; 60 61 65 public Integer getAttributeId() 66 { 67 return attributeId; 68 } 69 70 74 public void setAttributeId(Integer newAttributeId) 75 { 76 this.attributeId = newAttributeId; 77 } 78 79 83 public Integer getUserId() 84 { 85 return userId; 86 } 87 88 92 public void setUserId(Integer newUserId) 93 { 94 this.userId = newUserId; 95 } 96 97 public boolean equals(Object obj) 98 { 99 boolean result = obj == this; 100 if (!result && obj instanceof ReportUserAttribute) 101 { 102 ReportUserAttribute rua = (ReportUserAttribute)obj; 103 result = ObjectUtils.equals(userId, rua.getUserId()) 104 && ObjectUtils.equals(attributeId, rua.getAttributeId()); 105 } 106 Log.get().debug("Compare " + obj + " and " + this + " -> " + result); 107 108 return result; 109 } 110 111 public int hashCode() 112 { 113 int result = userId == null ? 0 : userId.intValue(); 114 if (attributeId != null) 115 { 116 result += attributeId.intValue(); 117 } 118 return result; 119 } 120 121 public String toString() 122 { 123 return super.toString() + " {a=" + attributeId + ", u=" + userId + "}"; 124 } 125 126 130 public String getQueryKey() 131 { 132 return queryKey == null ? "" : queryKey; 133 } 134 135 139 public void setQueryKey(String newQueryKey) 140 { 141 this.queryKey = newQueryKey; 142 } 143 } 144 | Popular Tags |