public <T> TypeInformation<? extends T> readType(S source, TypeInformation<T> basicType) { Assert.notNull(source, "Source must not be null!"); Assert.notNull(basicType, "Basic type must not be null!"); Class<?> documentsTargetType = getDefaultedTypeToBeUsed(source); if (documentsTargetType == null) { return basicType; } Class<T> rawType = basicType.getType(); boolean isMoreConcreteCustomType = rawType == null || rawType.isAssignableFrom(documentsTargetType) && !rawType.equals(documentsTargetType); if (!isMoreConcreteCustomType) { return basicType; } ClassTypeInformation<?> targetType = ClassTypeInformation.from(documentsTargetType); return (TypeInformation<? extends T>) basicType.specialize(targetType); }
@Override public <T> TypeInformation<? extends T> readType(final VPackSlice source, final TypeInformation<T> basicType) { Assert.notNull(source, "Source must not be null!"); Assert.notNull(basicType, "Basic type must not be null!"); final TypeInformation<?> documentsTargetType = readType(source); if (documentsTargetType == null) { return basicType; } final Class<T> rawType = basicType.getType(); final boolean isMoreConcreteCustomType = rawType == null || rawType.isAssignableFrom(documentsTargetType.getType()) && !rawType.equals(documentsTargetType); if (!isMoreConcreteCustomType) { return basicType; } final ClassTypeInformation<?> targetType = ClassTypeInformation.from(documentsTargetType.getType()); return (TypeInformation<? extends T>) basicType.specialize(targetType); }
@Override public <T> TypeInformation<? extends T> readType(final VPackSlice source, final TypeInformation<T> basicType) { Assert.notNull(source, "Source must not be null!"); Assert.notNull(basicType, "Basic type must not be null!"); final TypeInformation<?> documentsTargetType = readType(source); if (documentsTargetType == null) { return basicType; } final Class<T> rawType = basicType.getType(); final boolean isMoreConcreteCustomType = rawType == null || rawType.isAssignableFrom(documentsTargetType.getType()) && !rawType.equals(documentsTargetType); if (!isMoreConcreteCustomType) { return basicType; } final ClassTypeInformation<?> targetType = ClassTypeInformation.from(documentsTargetType.getType()); return (TypeInformation<? extends T>) basicType.specialize(targetType); }