将 GenericObject 转换为具体对象

@param genericObject 待转换的GenericObject
@return 转换后结果
344947
public static <T> T convertToObject(Object genericObject) {

        try {
            return (T) innerToConvertObject(genericObject, new IdentityHashMap<Object, Object>());
        } catch (Throwable t) {
            throw new ConvertException(t);
        }
    }
884597
private ArrayTypeSignature getArrayTypeSignature(
			GenericArrayType genericArrayType) {
		FullTypeSignature componentTypeSignature = getFullTypeSignature(genericArrayType
				.getGenericComponentType());
		ArrayTypeSignature arrayTypeSignature = new ArrayTypeSignature(
				componentTypeSignature);
		return arrayTypeSignature;
	}
19578
static public <T> Class<? extends T> getClass(T obj)
	{
		return (Class<? extends T>)obj.getClass();
	}
1184822
private static Class<?> extractGeneric(Type type) {
        if (type instanceof ParameterizedType) {
            Type[] genericTypes = ((ParameterizedType) type).getActualTypeArguments();
            if (genericTypes.length > 0 && genericTypes[0] instanceof Class) {
                return (Class<?>) genericTypes[0];
            }
        }
        return Object.class;
    }
764417
public static Class<?> getListInnerClassFromGenericType(Type genericType) {
        ParameterizedType innerClass = (ParameterizedType) genericType;
        return (Class<?>) innerClass.getActualTypeArguments()[0];
    }
1248882
public static Type[] getParameterTypes(Type generic) {
		Type[] types = null;
		if(isGeneric(generic)) {
			types = ((ParameterizedType)generic).getActualTypeArguments();
		}
		return types;
	}
3001
public static <T> T map(byte[] content, Class<T> genericType, Charset charset) {
        // 获取映射对象
        ObjectMetaData objectMap = getObjectMap(genericType);
        if (LOGGER.isDebugEnabled()) {
            objectMap.dumpObjectMetaData();
        }

        try {
            return mapByIndex(content, genericType, objectMap, charset);
        } catch (InstantiationException ie) {
            LOGGER.debug("Cannot instantiate: ", ie);
            throw new FdfsColumnMapException(ie);
        } catch (IllegalAccessException iae) {
            LOGGER.debug("Illegal access: ", iae);
            throw new FdfsColumnMapException(iae);
        } catch (InvocationTargetException ite) {
            LOGGER.debug("Cannot invoke method: ", ite);
            throw new FdfsColumnMapException(ite);
        }
    }
445989
public static <T extends GenericEvent> GenericEventType getTypeOf(Class<T> clazz) {
    
    GenericEventType eventType = TYPE_MAP.get(clazz);
    
    if (eventType == null) {
      eventType = new GenericEventType();
      TYPE_MAP.put(clazz, eventType);
    }
    
    return eventType;
  }
643087
public static <T extends FieldDescription> ElementMatcher.Junction<T> genericFieldType(TypeDescription.Generic fieldType) {
        return genericFieldType(is(fieldType));
    }
935765
private <T> List<FieldMetaData> praseFieldList(Class<T> genericType) {
        Field[] fields = genericType.getDeclaredFields();
        List<FieldMetaData> mapedFieldList = new ArrayList<FieldMetaData>();
        for (int i = 0; i < fields.length; i++) {
            if (fields[i].isAnnotationPresent(FdfsColumn.class)) {
                FieldMetaData fieldMetaData = new FieldMetaData(fields[i], fieldsTotalSize);
                mapedFieldList.add(fieldMetaData);
                // 计算偏移量
                fieldsTotalSize += fieldMetaData.getRealeSize();
                // 如果是动态计算列
                if (fieldMetaData.isDynamicField()) {
                    dynamicFieldList.add(fieldMetaData);
                }
            }
        }
        return mapedFieldList;
    }
375978
public <T> T copy (T object) {
		if (object == null) return null;
		if (copyShallow) return object;
		copyDepth++;
		try {
			if (originalToCopy == null) originalToCopy = new IdentityMap();
			Object existingCopy = originalToCopy.get(object);
			if (existingCopy != null) return (T)existingCopy;

			if (copyReferences) needsCopyReference = object;
			Object copy;
			if (object instanceof KryoCopyable)
				copy = ((KryoCopyable)object).copy(this);
			else
				copy = getSerializer(object.getClass()).copy(this, object);
			if (needsCopyReference != null) reference(copy);
			if (TRACE || (DEBUG && copyDepth == 1)) log("Copy", copy, -1);
			return (T)copy;
		} finally {
			if (--copyDepth == 0) reset();
		}
	}
1173172
public GenericNack genericNack(byte[] b) {
        GenericNack req = new GenericNack();
        assignHeader(req, b);
        return req;
    }
667244
@Override
	public <T> T getObject(final int columnIndex, final Class<T> type) throws SQLException {
		String columnLabel = getWrapped().getMetaData().getColumnLabel(columnIndex);

		return getObject(columnLabel, type);
	}
1215544
@SuppressWarnings("unchecked")
    public static <T> T asType(Object obj, Class<T> type) {
        if (String.class == type) {
            return (T) InvokerHelper.toString(obj);
        }

        // fall back to cast
        try {
            return (T) DefaultTypeTransformation.castToType(obj, type);
        }
        catch (GroovyCastException e) {
            MetaClass mc = InvokerHelper.getMetaClass(obj);
            if (mc instanceof ExpandoMetaClass) {
                ExpandoMetaClass emc = (ExpandoMetaClass) mc;
                Object mixedIn = emc.castToMixedType(obj, type);
                if (mixedIn != null)
                    return (T) mixedIn;
            }
            if (type.isInterface()) {
                try {
                    List<Class> interfaces = new ArrayList<Class>();
                    interfaces.add(type);
                    return (T) ProxyGenerator.INSTANCE.instantiateDelegate(interfaces, obj);
                } catch (GroovyRuntimeException cause) {
                    // ignore
                }
            }
            throw e;
        }
    }
389951
@SuppressWarnings("unchecked") // types must agree
  private static List createListObject(ParameterizedType type) {

    Class rawType = (Class) type.getRawType();
    Type[] genericTypes = type.getActualTypeArguments();
    List listObject;

    if (rawType.isInterface()) {
      listObject = new ArrayList(MOCK_LIST_COUNT);
    } else {
      listObject = (List) instantiateObject(rawType);
    }

    for (int i = 0; i < MOCK_LIST_COUNT; i++) {
      listObject.add(generateValue((Class) genericTypes[0]));
    }

    return listObject;
  }
954749
public static <T> int deleteObject(T object)
    {
        return SqlClosure.sqlExecute(c ->  OrmElf.deleteObject(c, object));
    }
1214187
public List<GenericType> getGenericParameterTypes() {
        if (root.children.isEmpty()) {
            return null;
        }

        List<GenericType> genericParameters = new ArrayList<GenericType>();
        putAllChildren(root, genericParameters);
        return unmodifiableList(new ArrayList<GenericType>(genericParameters));
    }