/* (non-Javadoc) * @see org.springframework.data.util.TypeInformation#getComponentType() */ public TypeInformation<?> getComponentType() { if (!(isMap() || isCollectionLike())) { return null; } if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; return createInfo(parameterizedType.getActualTypeArguments()[0]); } Class<S> rawType = getType(); if (isMap()) { return getTypeArgument(rawType, Map.class, 0); } if (Iterable.class.isAssignableFrom(rawType)) { return getTypeArgument(rawType, Iterable.class, 0); } if (rawType.isArray()) { return createInfo(rawType.getComponentType()); } return null; }
/* (non-Javadoc) * @see org.springframework.data.util.TypeInformation#isCollectionLike() */ public boolean isCollectionLike() { Class<?> rawType = getType(); return rawType.isArray() || Iterable.class.isAssignableFrom(rawType); }