Class VariantMapper
- java.lang.Object
-
- com.snowflake.connectors.util.variant.VariantMapper
-
public class VariantMapper extends Object
Utility class forSnowpark Variant
mapping.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Variant
mapToVariant(T value)
Maps the provided value toVariant
.static <T> T
mapVariant(Variant variant, JavaType clazz)
static <T> T
mapVariant(Variant variant, Class<T> clazz)
Maps the providedVariant
to an instance of the provided class.
-
-
-
Method Detail
-
mapVariant
public static <T> T mapVariant(Variant variant, Class<T> clazz)
Maps the providedVariant
to an instance of the provided class.- Type Parameters:
T
- type of the provided class- Parameters:
variant
- variant to mapclazz
- class to which the variant will be mapped- Returns:
- an object of a given class, created by mapping the variant
- Throws:
VariantMapperException
- if the provided variant can not be mapped to an instance of the provided class
-
mapVariant
public static <T> T mapVariant(Variant variant, JavaType clazz)
- Type Parameters:
T
- type of the provided class- Parameters:
variant
- variant to mapclazz
- class to which the variant will be mapped- Returns:
- an object of a given class, created by mapping the variant
- Throws:
VariantMapperException
- if the provided variant can not be mapped to an instance of the provided class
-
mapToVariant
public static <T> Variant mapToVariant(T value)
Maps the provided value toVariant
.- Type Parameters:
T
- type of the provided value- Parameters:
value
- value to map- Returns:
- Variant created from the provided value
- Throws:
VariantMapperException
- if the provided value can not be mapped to Variant
-
-