Class Serialization
- java.lang.Object
-
- io.fabric8.kubernetes.client.utils.Serialization
-
public class Serialization extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods 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()
-
-
-
Method Detail
-
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)
-
asYaml
public static <T> String asYaml(T object)
-
unmarshal
public static <T> T unmarshal(InputStream is)
Unmarshals a stream.- Type Parameters:
T- The target type.- Parameters:
is- TheInputStream.- Returns:
- returns de-serialized object
-
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- TheInputStream.parameters- AMapwith parameters for placeholder substitution.- Returns:
- returns returns de-serialized object
-
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- 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
public static <T> T unmarshal(String str, Class<T> type)
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)
Unmarshals 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
-
unmarshal
public static <T> T unmarshal(InputStream is, Class<T> type)
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)
Unmarshals 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
-
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
-
-