public static <T> getFieldByColumnName(Object obj, String columnName) throws Exception { for (Field field : obj.getClass().getDeclaredFields()) { Annotation a = field.getAnnotation(Column.class); if (a != null && a.getValue().equals(columnName)) { return <T> field.get(obj); } } throw new IllegalArgumentException("No such column:" + columnName); }
public Object getFieldValue(_Fields field) { switch (field) { case TIMESTAMP: return Long.valueOf(getTimestamp()); case VALUE: return getValue(); case HOST: return getHost(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case TIMESTAMP: return Long.valueOf(getTimestamp()); case VALUE: return getValue(); case HOST: return getHost(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case TIMESTAMP: return Long.valueOf(getTimestamp()); case VALUE: return getValue(); case HOST: return getHost(); case DURATION: return Integer.valueOf(getDuration()); } throw new IllegalStateException(); }
if (annotation.getValue().equals(zipkinCoreConstants.CLIENT_SEND) || annotation.getValue().equals(zipkinCoreConstants.SERVER_RECV)) { assertTrue(startTime <= annotation.getTimestamp()); assertTrue(annotation.getTimestamp() <= annoStartTime); } else if (annotation.getValue().equals(zipkinCoreConstants.CLIENT_RECV) || annotation.getValue().equals(zipkinCoreConstants.SERVER_SEND)) { assertTrue(annoEndTime <= annotation.getTimestamp()); assertTrue(annotation.getTimestamp() <= endTime);