com.newrelic.opentracing.events.Event Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-java-lambda Show documentation
Show all versions of newrelic-java-lambda Show documentation
New Relic OpenTracing Tracer implementation for instrumenting AWS Lambda functions.
The newest version!
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package com.newrelic.opentracing.events;
import org.json.simple.JSONArray;
import org.json.simple.JSONAware;
import java.util.Arrays;
import java.util.Map;
public abstract class Event implements JSONAware {
public abstract Map getIntrinsics();
public abstract Map getUserAttributes();
public abstract Map getAgentAttributes();
/**
* Print an event according to the following data format: an array of 3 hashes representing intrinsics,
* user attributes, and agent attributes.
*/
@Override
public String toString() {
return toJSONString();
}
@Override
public String toJSONString() {
return JSONArray.toJSONString(Arrays.asList(getIntrinsics(), getUserAttributes(), getAgentAttributes()));
}
}