1 16 package org.apache.commons.attributes.test; 17 18 23 public class Dependency { 24 25 private final Class clazz; 26 private final String name; 27 28 public Dependency (Class clazz, String name) { 29 this.clazz = clazz; 30 this.name = name; 31 } 32 33 public Class getDependencyClass () { 34 return clazz; 35 } 36 37 public String getDependencyName () { 38 return name; 39 } 40 41 public boolean equals (Object o) { 42 return o instanceof Dependency && 43 ((Dependency) o).clazz == clazz && 44 ((Dependency) o).name.equals (name); 45 } 46 47 public int hashCode () { 48 return clazz.hashCode () ^ name.hashCode (); 49 } 50 51 public String toString () { 52 return "[Dependency on " + clazz.getName () + " via name \"" + name + "\"]"; 53 } 54 } | Popular Tags |