marquez.db.FacetUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marquez-api Show documentation
Show all versions of marquez-api Show documentation
Collect, aggregate, and visualize a data ecosystem's metadata
/*
* 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));
}
}