All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.jaegertracing.analytics.query.json.JsonSpanDeserializer Maven / Gradle / Ivy

package io.jaegertracing.analytics.query.json;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.jaegertracing.analytics.model.Trace;
import io.jaegertracing.analytics.query.RestResult;
import java.io.IOException;

/**
 * @author Pavol Loffay
 */
public class JsonSpanDeserializer {
  private static final ObjectMapper objectMapper = JsonHelper.configure(new ObjectMapper());

  public static Trace deserialize(byte[] json) throws IOException {
    RestResult restResult = objectMapper.readValue(json, new TypeReference>() {});
    if (restResult.getData().size() > 0) {
      return restResult.getData().get(0);
    }
    return null;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy