| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | public String toString() { |
| 62 | try { |
| 63 | Method getValue = getClass().getMethod("getValue"); |
| 64 | Object value = getValue.invoke(this); |
| 65 | if (value == null) { |
| 66 | return String.format("null@0x%x", Pointer.nativeValue(getPointer())); |
| 67 | } |
| 68 | return String.format("%s@0x%x=%s", value.getClass().getSimpleName(), Pointer.nativeValue(getPointer()), |
| 69 | value); |
| 70 | } catch (Exception ex) { |
| 71 | return String.format("ByReference Contract violated - %s#getValue raised exception: %s", |
| 72 | getClass().getName(), ex.getMessage()); |
| 73 | } |
| 74 | } |
| 75 | } |