1 22 package org.jboss.beans.metadata.plugins; 23 24 import org.jboss.util.JBossObject; 25 import org.jboss.util.JBossStringBuilder; 26 27 30 public class InjectionType extends JBossObject 31 { 32 33 public static final InjectionType BY_CLASS = new InjectionType("ByClass"); 34 35 36 public static final InjectionType BY_NAME = new InjectionType("ByName"); 37 38 39 protected final String typeString; 40 41 46 public InjectionType(String typeString) 47 { 48 if (typeString == null) 49 throw new IllegalArgumentException ("Null type string"); 50 this.typeString = typeString; 51 } 52 53 58 public String getTypeString() 59 { 60 return typeString; 61 } 62 63 public boolean equals(Object object) 64 { 65 if (object == null || object instanceof InjectionType == false) 66 return false; 67 InjectionType other = (InjectionType) object; 68 return typeString.equals(other.getTypeString()); 69 } 70 71 public void toString(JBossStringBuilder buffer) 72 { 73 buffer.append(typeString); 74 } 75 76 protected int getHashCode() 77 { 78 return typeString.hashCode(); 79 } 80 81 } 82 | Popular Tags |