Class OpenLineageClientUtils


  • public final class OpenLineageClientUtils
    extends java.lang.Object
    Utilities class for OpenLineageClient.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void configureObjectMapper​(java.lang.String... disableFacets)
      Configure object mapper to exclude specified facets from being serialized
      static <T> T convertValue​(java.lang.Object fromValue, java.lang.Class<T> toValueType)  
      static <T> T fromJson​(@NonNull java.lang.String json, @NonNull com.fasterxml.jackson.core.type.TypeReference<T> type)
      Converts the provided Json string to the specified type.
      static OpenLineageYaml loadOpenLineageYaml​(ConfigPathProvider configPathProvider)  
      static OpenLineageYaml loadOpenLineageYaml​(java.io.InputStream inputStream)  
      static <T,​F>
      T
      mergeFacets​(java.util.Map<java.lang.String,​F> facetsMap, T facetsContainer, java.lang.Class<T> klass)
      Create a new instance of the facets container with all values merged from the original facetsContainer and the given facets Map, with precedence given to the facets Map.
      static com.fasterxml.jackson.databind.ObjectMapper newObjectMapper()
      Returns a new ObjectMapper instance.
      static OpenLineage.RunEvent runEventFromJson​(@NonNull java.lang.String json)
      Converts the provided Json string to OpenLineage.RunEvent.
      static java.lang.String toJson​(@NonNull java.lang.Object value)
      Converts the provided value to a Json string.
      static java.net.URI toUri​(@NonNull java.lang.String urlString)
      Converts the provided urlString to an URI object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper newObjectMapper()
        Returns a new ObjectMapper instance.
      • configureObjectMapper

        public static void configureObjectMapper​(java.lang.String... disableFacets)
        Configure object mapper to exclude specified facets from being serialized
        Parameters:
        disableFacets -
      • toJson

        public static java.lang.String toJson​(@NonNull
                                              @NonNull java.lang.Object value)
        Converts the provided value to a Json string.
      • fromJson

        public static <T> T fromJson​(@NonNull
                                     @NonNull java.lang.String json,
                                     @NonNull
                                     @NonNull com.fasterxml.jackson.core.type.TypeReference<T> type)
        Converts the provided Json string to the specified type.
      • runEventFromJson

        public static OpenLineage.RunEvent runEventFromJson​(@NonNull
                                                            @NonNull java.lang.String json)
        Converts the provided Json string to OpenLineage.RunEvent. Useful as other `fromJson` method gets shaded.
      • convertValue

        public static <T> T convertValue​(java.lang.Object fromValue,
                                         java.lang.Class<T> toValueType)
      • mergeFacets

        public static <T,​F> T mergeFacets​(java.util.Map<java.lang.String,​F> facetsMap,
                                                T facetsContainer,
                                                java.lang.Class<T> klass)
        Create a new instance of the facets container with all values merged from the original facetsContainer and the given facets Map, with precedence given to the facets Map.
      • toUri

        public static java.net.URI toUri​(@NonNull
                                         @NonNull java.lang.String urlString)
        Converts the provided urlString to an URI object.
      • loadOpenLineageYaml

        public static OpenLineageYaml loadOpenLineageYaml​(java.io.InputStream inputStream)