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> String
asJson(T object)
static <T> String
asYaml(T object)
static com.fasterxml.jackson.databind.ObjectMapper
jsonMapper()
static <T> T
unmarshal(InputStream is)
Unmarshals a stream.static <T> T
unmarshal(InputStream is, com.fasterxml.jackson.core.type.TypeReference<T> type)
Unmarshals anInputStream
.static <T> T
unmarshal(InputStream is, com.fasterxml.jackson.core.type.TypeReference<T> type, Map<String,String> parameters)
Unmarshals anInputStream
optionally performing placeholder substitution to the stream.static <T> T
unmarshal(InputStream is, com.fasterxml.jackson.databind.ObjectMapper mapper)
Unmarshals a stream.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.static <T> T
unmarshal(InputStream is, Class<T> type)
Unmarshals anInputStream
.static <T> T
unmarshal(InputStream is, Class<T> type, Map<String,String> parameters)
Unmarshals anInputStream
optionally performing placeholder substitution to the stream.static <T> T
unmarshal(InputStream is, Map<String,String> parameters)
Unmarshals a stream optionally performing placeholder substitution to the stream.static <T> T
unmarshal(String str, Class<T> type)
Unmarshals aString
static <T> T
unmarshal(String str, Class<T> type, Map<String,String> parameters)
Unmarshals aString
optionally performing placeholder substitution to the String.static com.fasterxml.jackson.databind.ObjectMapper
yamlMapper()
-
-
-
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
- AMap
with 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
- TheObjectMapper
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
- TheInputStream
.mapper
- TheObjectMapper
to use.parameters
- AMap
with 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 aString
optionally 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 anInputStream
optionally performing placeholder substitution to the stream.- Type Parameters:
T
- Template argument denoting type- Parameters:
is
- TheInputStream
.type
- The type.parameters
- AMap
with 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 anInputStream
optionally performing placeholder substitution to the stream.- Type Parameters:
T
- Template argument denoting type- Parameters:
is
- TheInputStream
.type
- TheTypeReference
.parameters
- AMap
with parameters for placeholder substitution.- Returns:
- returns de-serialized object
-
-