@Override public Object get(Value value, Class clazz, CoderContext context) { Measure<?> m = new Measure(); String metricKey = value.getString(); org.sonar.api.batch.measure.Metric metric = metricFinder.findByKey(metricKey); if (metric == null) { throw new IllegalStateException("Unknow metric with key " + metricKey); } m.setMetric((org.sonar.api.measures.Metric) metric); m.setRawValue(value.isNull(true) ? null : value.getDouble()); m.setData(value.getString()); m.setDescription(value.getString()); m.setAlertStatus(value.isNull(true) ? null : Metric.Level.valueOf(value.getString())); m.setAlertText(value.getString()); m.setDate(value.getDate()); m.setVariation1(value.isNull(true) ? null : value.getDouble()); m.setVariation2(value.isNull(true) ? null : value.getDouble()); m.setVariation3(value.isNull(true) ? null : value.getDouble()); m.setVariation4(value.isNull(true) ? null : value.getDouble()); m.setVariation5(value.isNull(true) ? null : value.getDouble()); m.setUrl(value.getString()); m.setPersonId(value.isNull(true) ? null : value.getInt()); m.setPersistenceMode(value.isNull(true) ? null : PersistenceMode.valueOf(value.getString())); return m; } }
@Override public Object get(Value value, Class clazz, CoderContext context) { Measure<?> m = new Measure(); String metricKey = value.getString(); org.sonar.api.batch.measure.Metric metric = metricFinder.findByKey(metricKey); if (metric == null) { throw new IllegalStateException("Unknow metric with key " + metricKey); } m.setMetric((org.sonar.api.measures.Metric) metric); m.setRawValue(value.isNull(true) ? null : value.getDouble()); m.setData(value.getString()); m.setDescription(value.getString()); m.setAlertStatus(value.isNull(true) ? null : Metric.Level.valueOf(value.getString())); m.setAlertText(value.getString()); m.setTendency(value.isNull(true) ? null : value.getInt()); m.setDate(value.getDate()); m.setVariation1(value.isNull(true) ? null : value.getDouble()); m.setVariation2(value.isNull(true) ? null : value.getDouble()); m.setVariation3(value.isNull(true) ? null : value.getDouble()); m.setVariation4(value.isNull(true) ? null : value.getDouble()); m.setVariation5(value.isNull(true) ? null : value.getDouble()); m.setUrl(value.getString()); m.setCharacteristic(value.isNull(true) ? null : techDebtModel.characteristicById(value.getInt())); m.setRequirement(value.isNull(true) ? null : techDebtModel.requirementsById(value.getInt())); m.setPersonId(value.isNull(true) ? null : value.getInt()); m.setPersistenceMode(value.isNull(true) ? null : PersistenceMode.valueOf(value.getString())); return m; } }