Class Serialization
java.lang.Object
io.fabric8.kubernetes.client.utils.Serialization
public class Serialization extends Object
-
Constructor Summary
Constructors Constructor Description Serialization() -
Method Summary
Modifier and Type Method Description static <T> StringasJson(T object)static <T> StringasYaml(T object)static com.fasterxml.jackson.databind.ObjectMapperjsonMapper()static <T> Tunmarshal(InputStream is)Unmarshals a stream.static <T> Tunmarshal(InputStream is, com.fasterxml.jackson.core.type.TypeReference<T> type)Unmarshals anInputStream.static <T> Tunmarshal(InputStream is, com.fasterxml.jackson.core.type.TypeReference<T> type, Map<String,String> parameters)Unmarshals anInputStreamoptionally performing placeholder substitution to the stream.static <T> Tunmarshal(InputStream is, com.fasterxml.jackson.databind.ObjectMapper mapper)Unmarshals a stream.static <T> Tunmarshal(InputStream is, com.fasterxml.jackson.databind.ObjectMapper mapper, Map<String,String> parameters)Unmarshals a stream optionally performing placeholder substitution to the stream.static <T> Tunmarshal(InputStream is, Class<T> type)Unmarshals anInputStream.static <T> Tunmarshal(InputStream is, Class<T> type, Map<String,String> parameters)Unmarshals anInputStreamoptionally performing placeholder substitution to the stream.static <T> Tunmarshal(InputStream is, Map<String,String> parameters)Unmarshals a stream optionally performing placeholder substitution to the stream.static <T> Tunmarshal(String str, Class<T> type)Unmarshals aStringstatic <T> Tunmarshal(String str, Class<T> type, Map<String,String> parameters)Unmarshals aStringoptionally performing placeholder substitution to the String.static com.fasterxml.jackson.databind.ObjectMapperyamlMapper()
-
Constructor Details
-
Serialization
public Serialization()
-
-
Method Details
-
jsonMapper
public static com.fasterxml.jackson.databind.ObjectMapper jsonMapper() -
yamlMapper
public static com.fasterxml.jackson.databind.ObjectMapper yamlMapper() -
asJson
- Throws:
KubernetesClientException
-
asYaml
- Throws:
KubernetesClientException
-
unmarshal
Unmarshals a stream.- Type Parameters:
T- The target type.- Parameters:
is- TheInputStream.- Returns:
- returns de-serialized object
- Throws:
KubernetesClientException- KubernetesClientException
-
unmarshal
Unmarshals a stream optionally performing placeholder substitution to the stream.- Type Parameters:
T- The target type.- Parameters:
is- TheInputStream.parameters- AMapwith parameters for placeholder substitution.- Returns:
- returns returns de-serialized object
- Throws:
KubernetesClientException- KubernetesClientException
-
unmarshal
Unmarshals a stream.- Type Parameters:
T- The target type.- Parameters:
is- TheInputStream.mapper- TheObjectMapperto 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- TheInputStream.mapper- TheObjectMapperto use.parameters- AMapwith parameters for placeholder substitution.- Returns:
- returns de-serialized object
-
unmarshal
Unmarshals aString- Type Parameters:
T- template argument denoting type- Parameters:
str- TheString.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 KubernetesClientExceptionUnmarshals aStringoptionally performing placeholder substitution to the String.- Type Parameters:
T- Template argument denoting type- Parameters:
str- TheString.type- The target type.parameters- A hashmap containing parameters- Returns:
- returns de-serialized object
- Throws:
KubernetesClientException- KubernetesClientException
-
unmarshal
Unmarshals anInputStream.- Type Parameters:
T- Template argument denoting type- Parameters:
is- TheInputStream.type- The type.- Returns:
- returns de-serialized object
-
unmarshal
public static <T> T unmarshal(InputStream is, Class<T> type, Map<String,String> parameters) throws KubernetesClientExceptionUnmarshals anInputStreamoptionally performing placeholder substitution to the stream.- Type Parameters:
T- Template argument denoting type- Parameters:
is- TheInputStream.type- The type.parameters- AMapwith 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 anInputStream.- Type Parameters:
T- Template argument denoting type- Parameters:
is- TheInputStream.type- TheTypeReference.- 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 anInputStreamoptionally performing placeholder substitution to the stream.- Type Parameters:
T- Template argument denoting type- Parameters:
is- TheInputStream.type- TheTypeReference.parameters- AMapwith parameters for placeholder substitution.- Returns:
- returns de-serialized object
- Throws:
KubernetesClientException- KubernetesClientException
-