1 25 26 package org.objectweb.easybeans.deployment.annotations; 27 28 32 public class JField { 33 34 37 private String name = null; 38 39 42 private int access; 43 44 47 private String descriptor = null; 48 49 52 private String signature; 53 54 57 private Object value; 58 59 79 public JField(final int access, final String name, final String descriptor, final String signature, 80 final Object value) { 81 this.access = access; 82 this.name = name; 83 this.descriptor = descriptor; 84 this.signature = signature; 85 this.value = value; 86 } 87 88 93 @Override 94 public boolean equals(final Object obj) { 95 if (obj != null && obj instanceof JField) { 96 JField other = (JField) obj; 97 98 if (!this.name.equals(other.name)) { 100 return false; 101 } 102 103 if ((this.descriptor != null) && (!this.descriptor.equals(other.descriptor))) { 105 return false; 106 } 107 108 if ((this.signature != null) && (!this.signature.equals(other.signature))) { 110 return false; 111 } 112 113 return true; 115 } 116 return false; 117 } 118 119 122 @Override 123 public int hashCode() { 124 return name.hashCode(); 125 } 126 127 130 public String getDescriptor() { 131 return descriptor; 132 } 133 134 137 public Object getValue() { 138 return value; 139 } 140 141 144 public String getName() { 145 return name; 146 } 147 148 151 public String getSignature() { 152 return signature; 153 } 154 155 158 @Override 159 public String toString() { 160 StringBuilder sb = new StringBuilder (); 161 sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1)); 163 164 sb.append("[name="); 166 sb.append(name); 167 168 sb.append(", access="); 170 sb.append(access); 171 172 if (descriptor != null) { 174 sb.append(", descriptor="); 175 sb.append(descriptor); 176 } 177 178 if (signature != null) { 180 sb.append(", signature="); 181 sb.append(signature); 182 } 183 184 if (value != null) { 186 sb.append(", value="); 187 sb.append(value); 188 } 189 sb.append("]"); 190 return sb.toString(); 191 } 192 193 196 public int getAccess() { 197 return access; 198 } 199 } 200 | Popular Tags |