public final class TypeInfoUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TypeInfoUtils.PrimitiveParts |
Modifier and Type | Field and Description |
---|---|
static List<PrimitiveObjectInspector.PrimitiveCategory> |
dateTypeList |
static EnumMap<PrimitiveObjectInspector.PrimitiveCategory,Integer> |
dateTypes |
protected static org.slf4j.Logger |
LOG |
static List<PrimitiveObjectInspector.PrimitiveCategory> |
numericTypeList |
static EnumMap<PrimitiveObjectInspector.PrimitiveCategory,Integer> |
numericTypes |
Modifier and Type | Method and Description |
---|---|
static boolean |
doPrimitiveCategoriesMatch(TypeInfo ti1,
TypeInfo ti2)
returns true if both TypeInfos are of primitive type, and the primitive category matches.
|
static Type |
getArrayElementType(Type t)
Returns the array element type, if the Type is an array (Object[]), or
GenericArrayType (Map<String,String>[]).
|
static String |
getBaseName(String typeName) |
static int |
getCharacterLengthForType(PrimitiveTypeInfo typeInfo)
Return the character length of the type
|
static List<TypeInfo> |
getParameterTypeInfos(Method m,
int size)
Get the parameter TypeInfo for a method.
|
static ObjectInspector |
getStandardJavaObjectInspectorFromTypeInfo(TypeInfo typeInfo)
Returns the standard object inspector that can be used to translate an
object of that typeInfo to a standard object type.
|
static ObjectInspector |
getStandardWritableObjectInspectorFromTypeInfo(TypeInfo typeInfo)
Returns the standard object inspector that can be used to translate an
object of that typeInfo to a standard object type.
|
static TypeInfo |
getTypeInfoFromObjectInspector(ObjectInspector oi)
Get the TypeInfo object from the ObjectInspector object by recursively
going into the ObjectInspector structure.
|
static TypeInfo |
getTypeInfoFromTypeString(String typeString) |
static ArrayList<TypeInfo> |
getTypeInfosFromTypeString(String typeString) |
static List<String> |
getTypeStringsFromTypeInfo(List<TypeInfo> typeInfos) |
static boolean |
hasParameters(String typeName) |
static boolean |
implicitConvertible(PrimitiveObjectInspector.PrimitiveCategory from,
PrimitiveObjectInspector.PrimitiveCategory to)
Test if it's implicitly convertible for data comparison.
|
static boolean |
implicitConvertible(TypeInfo from,
TypeInfo to)
Returns whether it is possible to implicitly convert an object of Class
from to Class to.
|
static boolean |
isConversionRequiredForComparison(TypeInfo typeA,
TypeInfo typeB)
Given two types, determine whether conversion needs to occur to compare the two types.
|
static TypeInfoUtils.PrimitiveParts |
parsePrimitiveParts(String typeInfoString)
Make some of the TypeInfo parsing available as a utility.
|
static void |
registerDateType(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory,
int level) |
static void |
registerNumericType(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory,
int level) |
static ArrayList<TypeInfo> |
typeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector) |
static ArrayList<TypeInfo> |
typeInfosFromTypeNames(List<String> typeNames) |
protected static final org.slf4j.Logger LOG
public static List<PrimitiveObjectInspector.PrimitiveCategory> numericTypeList
public static EnumMap<PrimitiveObjectInspector.PrimitiveCategory,Integer> numericTypes
public static List<PrimitiveObjectInspector.PrimitiveCategory> dateTypeList
public static EnumMap<PrimitiveObjectInspector.PrimitiveCategory,Integer> dateTypes
public static Type getArrayElementType(Type t)
public static List<TypeInfo> getParameterTypeInfos(Method m, int size)
size
- In case the last parameter of Method is an array, we will try to
return a List<TypeInfo> with the specified size by repeating the
element of the array at the end. In case the size is smaller than
the minimum possible number of arguments for the method, null will
be returned.public static boolean hasParameters(String typeName)
public static boolean doPrimitiveCategoriesMatch(TypeInfo ti1, TypeInfo ti2)
ti1
- ti2
- public static TypeInfoUtils.PrimitiveParts parsePrimitiveParts(String typeInfoString)
public static ObjectInspector getStandardWritableObjectInspectorFromTypeInfo(TypeInfo typeInfo)
public static ObjectInspector getStandardJavaObjectInspectorFromTypeInfo(TypeInfo typeInfo)
public static TypeInfo getTypeInfoFromObjectInspector(ObjectInspector oi)
public static ArrayList<TypeInfo> typeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector)
public static ArrayList<TypeInfo> typeInfosFromTypeNames(List<String> typeNames)
public static ArrayList<TypeInfo> getTypeInfosFromTypeString(String typeString)
public static List<String> getTypeStringsFromTypeInfo(List<TypeInfo> typeInfos)
public static boolean isConversionRequiredForComparison(TypeInfo typeA, TypeInfo typeB)
typeA
- typeB
- public static int getCharacterLengthForType(PrimitiveTypeInfo typeInfo)
typeInfo
- public static void registerNumericType(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory, int level)
public static void registerDateType(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory, int level)
public static boolean implicitConvertible(PrimitiveObjectInspector.PrimitiveCategory from, PrimitiveObjectInspector.PrimitiveCategory to)
Copyright © 2022 The Apache Software Foundation. All rights reserved.