| 1 | package ch.poole.openinghoursparser; |
| 2 | |
| 3 | /** |
| 4 | * Force implementation of equals and hashcode |
| 5 | * |
| 6 | * @author Simon Poole |
| 7 | * |
| 8 | */ |
| 9 | abstract class Element implements Copy<Element> { |
| 10 | // put other methods from interface here |
| 11 | |
| 12 | @Override |
| 13 | public abstract boolean equals(Object other); |
| 14 | |
| 15 | @Override |
| 16 | public abstract int hashCode(); |
| 17 | |
| 18 | /** |
| 19 | * Create a string that identifies which class created it for debugging and testing |
| 20 | * |
| 21 | * @return the output of toString with the class name prepended |
| 22 | */ |
| 23 | public String toDebugString() { |
| 24 | return getClass().getSimpleName() + ":" + toString(); |
| 25 | } |
| 26 | } |