Class SpecUtils
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.api.utils.SpecUtils
-
public class SpecUtils extends java.lang.Object
Spec utilities.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INTERNAL_METADATA_JSON_KEY
-
Constructor Summary
Constructors Constructor Description SpecUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
clone(T object)
static <T extends AbstractFlinkSpec>
SpecWithMeta<T>deserializeSpecWithMeta(java.lang.String specWithMetaString, java.lang.Class<T> specClass)
Deserializes the spec and custom metadata object from JSON.static java.lang.String
writeSpecWithMeta(AbstractFlinkSpec spec, AbstractFlinkResource<?,?> relatedResource)
Serializes the spec and custom meta information into a JSON string.static java.lang.String
writeSpecWithMeta(AbstractFlinkSpec spec, ReconciliationMetadata metadata)
Serializes the spec and custom meta information into a JSON string.
-
-
-
Field Detail
-
INTERNAL_METADATA_JSON_KEY
public static final java.lang.String INTERNAL_METADATA_JSON_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
deserializeSpecWithMeta
public static <T extends AbstractFlinkSpec> SpecWithMeta<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)
-
-