added convenience constructor

This commit is contained in:
Timo Westkämper 2009-09-10 11:20:40 +00:00
parent 17b00016f5
commit ca1decbbde

View File

@ -43,6 +43,10 @@ public class PComparable<D extends Comparable> extends EComparable<D> implements
public PComparable(Class<? extends D> type, Path<?> parent, @NotEmpty String property) {
this(type, PathMetadata.forProperty(parent, property));
}
public PComparable(Path<?> parent, @NotEmpty String property) {
this((Class<? extends D>) Comparable.class, PathMetadata.forProperty(parent, property));
}
public boolean equals(Object o) {
return o instanceof Path ? ((Path<?>) o).getMetadata().equals(metadata)