Class SpecUtils


  • public class SpecUtils
    extends java.lang.Object
    Spec utilities.
    • Field Detail

      • INTERNAL_METADATA_JSON_KEY

        public static final java.lang.String INTERNAL_METADATA_JSON_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • SpecUtils

        public SpecUtils()
    • Method Detail

      • deserializeSpecWithMeta

        public static <T extends AbstractFlinkSpecSpecWithMeta<T> deserializeSpecWithMeta​(@Nullable
                                                                                            java.lang.String specWithMetaString,
                                                                                            java.lang.Class<T> specClass)
        Deserializes the spec and custom metadata object from JSON.
        Type Parameters:
        T - Spec type.
        Parameters:
        specWithMetaString - JSON string.
        specClass - Spec class for deserialization.
        Returns:
        SpecWithMeta of spec and meta.
      • writeSpecWithMeta

        public static java.lang.String writeSpecWithMeta​(AbstractFlinkSpec spec,
                                                         AbstractFlinkResource<?,​?> relatedResource)
        Serializes the spec and custom meta information into a JSON string.
        Parameters:
        spec - Flink resource spec.
        relatedResource - Related Flink resource for creating the meta object.
        Returns:
        Serialized json.
      • writeSpecWithMeta

        public static java.lang.String writeSpecWithMeta​(AbstractFlinkSpec spec,
                                                         ReconciliationMetadata metadata)
        Serializes the spec and custom meta information into a JSON string.
        Parameters:
        spec - Flink resource spec.
        metadata - Reconciliation meta object.
        Returns:
        Serialized json.
      • clone

        public static <T> T clone​(T object)