Package com.ibm.cloud.sdk.core.util
Class ResponseConverterUtils
- java.lang.Object
-
- com.ibm.cloud.sdk.core.util.ResponseConverterUtils
-
public final class ResponseConverterUtils extends java.lang.Object
Utility class to convert service responses into aResponseConverter
.- See Also:
ResponseConverter
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ResponseConverter<T>
getGenericObject(java.lang.reflect.Type type, java.lang.String property)
Creates a genericResponseConverter
for a generic class.static ResponseConverter<java.io.InputStream>
getInputStream()
Creates anInputStream
converter.static <T extends ObjectModel>
ResponseConverter<T>getObject(java.lang.Class<? extends T> type)
Creates a genericResponseConverter
for a POJO class that extends ObjectModel.static <T> ResponseConverter<T>
getObject(java.lang.reflect.Type type)
Creates a genericResponseConverter
for a POJO class.static ResponseConverter<java.lang.String>
getString()
Creates a genericResponseConverter
for a String response.static <T> ResponseConverter<T>
getValue(java.lang.Class<? extends T> type)
Creates a genericResponseConverter
for a non-object response.static <T> ResponseConverter<T>
getValue(java.lang.reflect.Type type)
Creates a genericResponseConverter
for a response with a Type instance that describes the type.static ResponseConverter<java.lang.Void>
getVoid()
Gets the void converter.
-
-
-
Method Detail
-
getGenericObject
public static <T> ResponseConverter<T> getGenericObject(java.lang.reflect.Type type, java.lang.String property)
Creates a genericResponseConverter
for a generic class.- Type Parameters:
T
- the generic type- Parameters:
type
- the typeproperty
- the property- Returns:
- the object converter
-
getInputStream
public static ResponseConverter<java.io.InputStream> getInputStream()
Creates anInputStream
converter.- Returns:
- the input stream converter
-
getObject
public static <T extends ObjectModel> ResponseConverter<T> getObject(java.lang.Class<? extends T> type)
Creates a genericResponseConverter
for a POJO class that extends ObjectModel.- Type Parameters:
T
- the generic type- Parameters:
type
- the type- Returns:
- the response converter
-
getObject
public static <T> ResponseConverter<T> getObject(java.lang.reflect.Type type)
Creates a genericResponseConverter
for a POJO class.- Type Parameters:
T
- the generic type- Parameters:
type
- a Type instance that describes the type- Returns:
- the response converter
-
getString
public static ResponseConverter<java.lang.String> getString()
Creates a genericResponseConverter
for a String response.- Returns:
- the string
-
getValue
public static <T> ResponseConverter<T> getValue(java.lang.Class<? extends T> type)
Creates a genericResponseConverter
for a non-object response.- Type Parameters:
T
- the generic type- Parameters:
type
- the type- Returns:
- the response converter
-
getValue
public static <T> ResponseConverter<T> getValue(java.lang.reflect.Type type)
Creates a genericResponseConverter
for a response with a Type instance that describes the type.- Type Parameters:
T
- the generic type- Parameters:
type
- the type- Returns:
- the response converter
-
getVoid
public static ResponseConverter<java.lang.Void> getVoid()
Gets the void converter.- Returns:
- the void converter
-
-