Improve AttributeKey.toString()

This commit is contained in:
Trustin Lee 2012-05-13 00:40:52 +09:00
parent 08137e2c49
commit 91c02c2823

View File

@ -12,6 +12,7 @@ public final class AttributeKey<T> implements Serializable, Comparable<Attribute
private final String name;
private final Class<T> valueType;
private final String strVal;
public AttributeKey(String name, Class<T> valueType) {
if (name == null) {
@ -27,6 +28,7 @@ public final class AttributeKey<T> implements Serializable, Comparable<Attribute
this.name = name;
this.valueType = valueType;
strVal = name + '[' + valueType.getSimpleName() + ']';
}
public String name() {
@ -37,16 +39,6 @@ public final class AttributeKey<T> implements Serializable, Comparable<Attribute
return valueType;
}
@Override
public int hashCode() {
return System.identityHashCode(this);
}
@Override
public boolean equals(Object o) {
return this == o;
}
@Override
public int compareTo(AttributeKey<T> o) {
return name().compareTo(o.name());
@ -54,6 +46,6 @@ public final class AttributeKey<T> implements Serializable, Comparable<Attribute
@Override
public String toString() {
return name();
return strVal;
}
}