Class Serialization

java.lang.Object
io.fabric8.kubernetes.client.utils.Serialization

public class Serialization
extends Object
  • Constructor Details

  • Method Details

    • jsonMapper

      public static com.fasterxml.jackson.databind.ObjectMapper jsonMapper()
    • yamlMapper

      public static com.fasterxml.jackson.databind.ObjectMapper yamlMapper()
    • asJson

      public static <T> String asJson​(T object) throws KubernetesClientException
      Throws:
      KubernetesClientException
    • asYaml

      public static <T> String asYaml​(T object) throws KubernetesClientException
      Throws:
      KubernetesClientException
    • unmarshal

      public static <T> T unmarshal​(InputStream is) throws KubernetesClientException
      Unmarshals a stream.
      Type Parameters:
      T - The target type.
      Parameters:
      is - The InputStream.
      Returns:
      returns de-serialized object
      Throws:
      KubernetesClientException - KubernetesClientException
    • unmarshal

      public static <T> T unmarshal​(InputStream is, Map<String,​String> parameters)
      Unmarshals a stream optionally performing placeholder substitution to the stream.
      Type Parameters:
      T - The target type.
      Parameters:
      is - The InputStream.
      parameters - A Map with parameters for placeholder substitution.
      Returns:
      returns returns de-serialized object
      Throws:
      KubernetesClientException - KubernetesClientException
    • unmarshal

      public static <T> T unmarshal​(InputStream is, com.fasterxml.jackson.databind.ObjectMapper mapper)
      Unmarshals a stream.
      Type Parameters:
      T - The target type.
      Parameters:
      is - The InputStream.
      mapper - The ObjectMapper to use.
      Returns:
      returns de-serialized object
    • unmarshal

      public static <T> T unmarshal​(InputStream is, com.fasterxml.jackson.databind.ObjectMapper mapper, Map<String,​String> parameters)
      Unmarshals a stream optionally performing placeholder substitution to the stream.
      Type Parameters:
      T - The target type.
      Parameters:
      is - The InputStream.
      mapper - The ObjectMapper to use.
      parameters - A Map with parameters for placeholder substitution.
      Returns:
      returns de-serialized object
    • unmarshal

      public static <T> T unmarshal​(String str, Class<T> type)
      Unmarshals a String
      Type Parameters:
      T - template argument denoting type
      Parameters:
      str - The String.
      type - The target type.
      Returns:
      returns de-serialized object
    • unmarshal

      public static <T> T unmarshal​(String str, Class<T> type, Map<String,​String> parameters) throws KubernetesClientException
      Unmarshals a String optionally performing placeholder substitution to the String.
      Type Parameters:
      T - Template argument denoting type
      Parameters:
      str - The String.
      type - The target type.
      parameters - A hashmap containing parameters
      Returns:
      returns de-serialized object
      Throws:
      KubernetesClientException - KubernetesClientException
    • unmarshal

      public static <T> T unmarshal​(InputStream is, Class<T> type)
      Unmarshals an InputStream.
      Type Parameters:
      T - Template argument denoting type
      Parameters:
      is - The InputStream.
      type - The type.
      Returns:
      returns de-serialized object
    • unmarshal

      public static <T> T unmarshal​(InputStream is, Class<T> type, Map<String,​String> parameters) throws KubernetesClientException
      Unmarshals an InputStream optionally performing placeholder substitution to the stream.
      Type Parameters:
      T - Template argument denoting type
      Parameters:
      is - The InputStream.
      type - The type.
      parameters - A Map with parameters for placeholder substitution.
      Returns:
      returns de-serialized object
      Throws:
      KubernetesClientException - KubernetesClientException
    • unmarshal

      public static <T> T unmarshal​(InputStream is, com.fasterxml.jackson.core.type.TypeReference<T> type)
      Unmarshals an InputStream.
      Type Parameters:
      T - Template argument denoting type
      Parameters:
      is - The InputStream.
      type - The TypeReference.
      Returns:
      returns de-serialized object
    • unmarshal

      public static <T> T unmarshal​(InputStream is, com.fasterxml.jackson.core.type.TypeReference<T> type, Map<String,​String> parameters)
      Unmarshals an InputStream optionally performing placeholder substitution to the stream.
      Type Parameters:
      T - Template argument denoting type
      Parameters:
      is - The InputStream.
      type - The TypeReference.
      parameters - A Map with parameters for placeholder substitution.
      Returns:
      returns de-serialized object
      Throws:
      KubernetesClientException - KubernetesClientException