1 11 package org.jboss.portal.core.impl.invocation; 12 13 19 public class MappingResult 20 { 21 22 private final Object target; 23 private final String targetPath; 24 private final String targetPathInfo; 25 26 public MappingResult(Object target, String targetPath, String targetPathInfo) 27 { 28 this.target = target; 29 this.targetPath = targetPath; 30 this.targetPathInfo = targetPathInfo; 31 } 32 33 public Object getTarget() 34 { 35 return target; 36 } 37 38 public String getTargetPathInfo() 39 { 40 return targetPathInfo; 41 } 42 43 public int hashCode() 44 { 45 int hashCode = (target != null ? target.hashCode() : 0) + 46 (targetPath != null ? targetPath.hashCode() : 0) + 47 (targetPathInfo != null ? targetPathInfo.hashCode() : 0); 48 return hashCode; 49 } 50 51 public boolean equals(Object obj) 52 { 53 if (obj == this) 54 { 55 return true; 56 } 57 if (obj instanceof MappingResult) 58 { 59 MappingResult other = (MappingResult)obj; 60 return (target == null ? (other.target == null) : target.equals(other.target)) && 61 (targetPath == null ? (other.targetPath == null) : targetPath.equals(other.targetPath)) && 62 (targetPathInfo == null ? (other.targetPathInfo == null) : targetPathInfo.equals(other.targetPathInfo)); 63 } 64 return false; 65 } 66 67 public String toString() 68 { 69 StringBuffer buffer = new StringBuffer ("MappingResult["); 70 buffer.append(target == null ? "-" : target.toString()); 71 buffer.append(','); 72 buffer.append(targetPath == null ? "-" : targetPath); 73 buffer.append(','); 74 buffer.append(targetPathInfo == null ? "-" : targetPathInfo); 75 buffer.append("]"); 76 return buffer.toString(); 77 } 78 } 79 | Popular Tags |