public abstract class TypeUtility extends Object
| Constructor and Description |
|---|
TypeUtility() |
| Modifier and Type | Method and Description |
|---|---|
static com.squareup.javapoet.ArrayTypeName |
arrayTypeName(Type type) |
static void |
beginStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
ModelProperty property)
generate begin string to translate in code to used in content value or
parameter need to be converted in string through String.valueOf
|
static void |
beginStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
com.squareup.javapoet.TypeName typeMirror)
generate begin string to translate in code to used in content value or
parameter need to be converted in string through String.valueOf
|
static void |
checkTypeCompatibility(SQLiteModelMethod method,
com.abubusoft.kripton.common.Pair<String,com.squareup.javapoet.TypeName> item,
ModelProperty property)
Check if type if compatibility
|
static com.squareup.javapoet.ClassName |
className(Class<?> clazz)
Convert a class in a classname
|
static com.squareup.javapoet.ClassName |
className(String className)
Generate class typeName
|
static com.squareup.javapoet.ClassName |
className(String packageName,
String className) |
static com.squareup.javapoet.ClassName |
classNameWithSuffix(String packageName,
String className,
String suffix)
Generate class typeName
|
static void |
endStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
ModelProperty property)
generate end string to translate in code to used in content value or
parameter need to be converted in string through String.valueOf
|
static void |
endStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
com.squareup.javapoet.TypeName typeMirror)
generate end string to translate in code to used in content value or
parameter need to be converted in string through String.valueOf
|
static String |
extractPackageName(TypeElement element) |
static List<com.squareup.javapoet.TypeName> |
getTypeArguments(TypeElement element)
Retrieve parametrized type of element (from its parent).
|
static boolean |
isArray(com.squareup.javapoet.TypeName typeName) |
static boolean |
isAssignable(com.squareup.javapoet.TypeName typeName,
Class<?> assignableClazz) |
static boolean |
isByteArray(com.squareup.javapoet.TypeName value)
Check if its type is byte[]
|
static boolean |
isCollection(com.squareup.javapoet.TypeName typeName) |
static boolean |
isEnum(String className) |
static boolean |
isEnum(com.squareup.javapoet.TypeName typeName)
Given an element, return true if it is a Enum class.
|
static boolean |
isEquals(Class<?> clazz1,
String clazz2) |
static boolean |
isEquals(com.squareup.javapoet.TypeName value,
ModelClass<?> entity)
Check if class that is rapresented by value has same typeName of entity
parameter.
|
static boolean |
isEquals(com.squareup.javapoet.TypeName value,
String className) |
static boolean |
isEquals(com.squareup.javapoet.TypeName value,
com.squareup.javapoet.TypeName kindOfParameter)
Check if class that is rapresented by value has same typeName of entity
parameter.
|
static boolean |
isList(com.squareup.javapoet.TypeName typeName) |
static boolean |
isMap(com.squareup.javapoet.TypeName typeName) |
static boolean |
isNullable(ModelProperty property) |
static boolean |
isNullable(SQLiteModelMethod method,
com.abubusoft.kripton.common.Pair<String,com.squareup.javapoet.TypeName> methodParam,
ModelProperty property)
Check if method parameter is nullable.
|
static boolean |
isNullable(com.squareup.javapoet.TypeName value) |
static boolean |
isSet(com.squareup.javapoet.TypeName typeName) |
static boolean |
isString(com.squareup.javapoet.TypeName value)
Check if its type is String
|
static boolean |
isTypeEquals(com.squareup.javapoet.TypeName value,
com.squareup.javapoet.TypeName value2) |
static boolean |
isTypeIncludedIn(com.squareup.javapoet.TypeName value,
Type... types) |
static boolean |
isTypePrimitive(com.squareup.javapoet.TypeName value) |
static boolean |
isTypeWrappedPrimitive(com.squareup.javapoet.TypeName value) |
static com.squareup.javapoet.TypeName |
mergeTypeName(String prefix,
TypeElement element) |
static com.squareup.javapoet.TypeName |
mergeTypeNameWithSuffix(com.squareup.javapoet.TypeName typeName,
String typeNameSuffix) |
static com.squareup.javapoet.TypeName |
parameterizedTypeName(com.squareup.javapoet.ClassName rawClass,
com.squareup.javapoet.TypeName paramClass) |
static String |
simpleName(com.squareup.javapoet.TypeName clazzName)
Return simple typeName of class
|
static com.squareup.javapoet.TypeName |
typeName(Element element)
Convert a TypeMirror in a typeName
|
static com.squareup.javapoet.TypeName |
typeName(String typeName)
Convert a TypeMirror in a typeName, or classname or whatever
|
static com.squareup.javapoet.TypeName |
typeName(String packageName,
String typeName)
Convert a TypeMirror in a typeName
|
static com.squareup.javapoet.TypeName |
typeName(Type type)
Convert a type in a typeName
|
static com.squareup.javapoet.TypeName |
typeName(TypeElement element,
String suffix) |
static com.squareup.javapoet.TypeName |
typeName(TypeMirror typeMirror)
Convert a TypeMirror in a typeName
|
public static boolean isTypeIncludedIn(com.squareup.javapoet.TypeName value,
Type... types)
public static boolean isTypeEquals(com.squareup.javapoet.TypeName value,
com.squareup.javapoet.TypeName value2)
public static boolean isTypePrimitive(com.squareup.javapoet.TypeName value)
public static boolean isTypeWrappedPrimitive(com.squareup.javapoet.TypeName value)
public static boolean isEquals(com.squareup.javapoet.TypeName value,
String className)
public static boolean isByteArray(com.squareup.javapoet.TypeName value)
value - public static boolean isString(com.squareup.javapoet.TypeName value)
value - public static boolean isNullable(com.squareup.javapoet.TypeName value)
public static boolean isEquals(com.squareup.javapoet.TypeName value,
ModelClass<?> entity)
value - entity - public static boolean isEquals(com.squareup.javapoet.TypeName value,
com.squareup.javapoet.TypeName kindOfParameter)
value - kindOfParameter - public static com.squareup.javapoet.ClassName classNameWithSuffix(String packageName, String className, String suffix)
packageName - className - suffix - public static com.squareup.javapoet.ClassName className(String className)
className - public static com.squareup.javapoet.ClassName className(Class<?> clazz)
clazz - public static com.squareup.javapoet.TypeName typeName(Type type)
type - public static com.squareup.javapoet.TypeName typeName(TypeMirror typeMirror)
typeMirror - public static com.squareup.javapoet.TypeName typeName(String packageName, String typeName)
typeName - public static com.squareup.javapoet.TypeName mergeTypeNameWithSuffix(com.squareup.javapoet.TypeName typeName,
String typeNameSuffix)
public static com.squareup.javapoet.TypeName typeName(String typeName)
typeName - public static com.squareup.javapoet.TypeName typeName(Element element)
element - public static boolean isNullable(ModelProperty property)
public static boolean isNullable(SQLiteModelMethod method, com.abubusoft.kripton.common.Pair<String,com.squareup.javapoet.TypeName> methodParam, ModelProperty property)
method - methodParam - property - public static void checkTypeCompatibility(SQLiteModelMethod method, com.abubusoft.kripton.common.Pair<String,com.squareup.javapoet.TypeName> item, ModelProperty property)
method - item - property - public static void beginStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
ModelProperty property)
public static void beginStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
com.squareup.javapoet.TypeName typeMirror)
property - public static void endStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
ModelProperty property)
public static void endStringConversion(com.squareup.javapoet.MethodSpec.Builder methodBuilder,
com.squareup.javapoet.TypeName typeMirror)
public static boolean isArray(com.squareup.javapoet.TypeName typeName)
public static com.squareup.javapoet.TypeName mergeTypeName(String prefix, TypeElement element)
public static com.squareup.javapoet.TypeName typeName(TypeElement element, String suffix)
public static com.squareup.javapoet.ClassName className(String packageName, String className)
public static com.squareup.javapoet.TypeName parameterizedTypeName(com.squareup.javapoet.ClassName rawClass,
com.squareup.javapoet.TypeName paramClass)
public static String simpleName(com.squareup.javapoet.TypeName clazzName)
clazz - public static com.squareup.javapoet.ArrayTypeName arrayTypeName(Type type)
public static boolean isEnum(com.squareup.javapoet.TypeName typeName)
elements - element - public static boolean isEnum(String className)
public static List<com.squareup.javapoet.TypeName> getTypeArguments(TypeElement element)
Retrieve parametrized type of element (from its parent).
element - public static boolean isCollection(com.squareup.javapoet.TypeName typeName)
public static boolean isList(com.squareup.javapoet.TypeName typeName)
public static boolean isSet(com.squareup.javapoet.TypeName typeName)
public static boolean isMap(com.squareup.javapoet.TypeName typeName)
public static boolean isAssignable(com.squareup.javapoet.TypeName typeName,
Class<?> assignableClazz)
public static String extractPackageName(TypeElement element)
Copyright © 2017. All rights reserved.