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

marquez.db.FacetUtils Maven / Gradle / Ivy

There is a newer version: 0.49.0
Show newest version
/*
 * Copyright 2018-2023 contributors to the Marquez project
 * SPDX-License-Identifier: Apache-2.0
 */

package marquez.db;

import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.NonNull;
import marquez.common.Utils;
import org.postgresql.util.PGobject;

public class FacetUtils {

  static ObjectNode asJson(@NonNull final String facetName, @NonNull Object facetValue) {
    final ObjectNode facetAsJson = Utils.getMapper().createObjectNode();
    facetAsJson.putPOJO(facetName, facetValue);
    return facetAsJson;
  }

  static PGobject toPgObject(String name, Object o) {
    return Columns.toPgObject(asJson(name, o));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy