org.opensearch.migrations.utils.TrackedFutureJsonFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trafficReplayer Show documentation
Show all versions of trafficReplayer Show documentation
Everything opensearch migrations
The newest version!
package org.opensearch.migrations.utils;
import java.util.function.Function;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Lombok;
import lombok.NonNull;
public class TrackedFutureJsonFormatter {
static ObjectMapper objectMapper = new ObjectMapper();
private TrackedFutureJsonFormatter() {}
public static String format(TrackedFuture tf) {
return format(tf, x -> null);
}
public static String format(
TrackedFuture tf,
@NonNull Function, String> resultFormatter
) {
try {
return objectMapper.writeValueAsString(TrackedFutureMapConverter.makeJson(tf, resultFormatter));
} catch (Exception e) {
throw Lombok.sneakyThrow(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy