1 package net.sf.openrocket.preset;
3 import net.sf.openrocket.unit.UnitGroup;
5 public class TypedKey<T> {
7 private final String name;
8 private final Class<T> type;
9 private final UnitGroup unitGroup;
11 public TypedKey(String name, Class<T> type) {
12 this(name, type, null);
15 public TypedKey(String name, Class<T> type, UnitGroup unitGroup) {
18 this.unitGroup = unitGroup;
22 public String toString() {
23 return "TypedKey [name=" + name + "]";
26 public String getName() {
30 public Class<T> getType() {
34 public UnitGroup getUnitGroup() {
39 public int hashCode() {
42 result = prime * result + ((name == null) ? 0 : name.hashCode());
43 result = prime * result + ((type == null) ? 0 : type.hashCode());
48 public boolean equals(Object obj) {
53 if (getClass() != obj.getClass())
55 TypedKey other = (TypedKey) obj;
57 if (other.name != null)
59 } else if (!name.equals(other.name))
62 if (other.type != null)
64 } else if (!type.equals(other.type))