1 25 26 package org.objectweb.easybeans.deployment.annotations; 27 28 29 34 public class JClassInterceptor { 35 36 39 private String className = null; 40 41 44 private JMethod jMethod = null; 45 46 49 private static final int NO_ID = -1; 50 51 54 private int id = NO_ID; 55 56 62 public JClassInterceptor(final String className, final JMethod jMethod, final int id) { 63 this.className = className; 64 this.jMethod = jMethod; 65 this.id = id; 66 } 67 68 73 public JClassInterceptor(final String className, final JMethod jMethod) { 74 this(className, jMethod, NO_ID); 75 } 76 77 80 public String getClassName() { 81 return className; 82 } 83 84 87 public JMethod getJMethod() { 88 return jMethod; 89 } 90 91 96 @Override 97 public boolean equals(final Object another) { 98 if (!(another instanceof JClassInterceptor)) { 99 return false; 100 } 101 JClassInterceptor anotherItcp = (JClassInterceptor) another; 102 if (id == NO_ID) { 103 return (anotherItcp.className.equals(className) && anotherItcp.jMethod.equals(jMethod)); 104 } 105 return (anotherItcp.className.equals(className) && anotherItcp.jMethod.equals(jMethod) && anotherItcp.id == id); 106 } 107 108 111 @Override 112 public int hashCode() { 113 return className.hashCode() + jMethod.hashCode(); 114 } 115 116 } 117 | Popular Tags |