1 3 package org.jgroups.conf; 4 5 6 12 public class ClassMap { 13 private final String mClassname; 14 private final String mDescription; 15 private final boolean mPreload; 16 private final int mMagicNumber; 17 18 public ClassMap(String clazz, 19 String desc, 20 boolean preload, 21 int magicnumber) { 22 mClassname=clazz; 23 mDescription=desc; 24 mPreload=preload; 25 mMagicNumber=magicnumber; 26 } 27 28 public int hashCode() { 29 return getMagicNumber(); 30 } 31 32 public String getClassName() { 33 return mClassname; 34 } 35 36 public String getDescription() { 37 return mDescription; 38 } 39 40 public boolean getPreload() { 41 return mPreload; 42 } 43 44 public int getMagicNumber() { 45 return mMagicNumber; 46 } 47 48 49 52 public Class getClassForMap() throws ClassNotFoundException { 53 return Thread.currentThread().getContextClassLoader().loadClass(getClassName()); 54 } 55 56 57 public boolean equals(Object another) { 58 if(another instanceof ClassMap) { 59 ClassMap obj=(ClassMap)another; 60 return getClassName().equals(obj.getClassName()); 61 } 62 else 63 return false; 64 } 65 66 67 } 68 | Popular Tags |