Return the ResolvableType representing the component type of the array or {@link #NONE} if this type does not represent
an array.

@see #isArray()
514427
public ResolvableType getComponentType() {
        if (this == NONE) {
            return NONE;
        }
        if (this.componentType != null) {
            return this.componentType;
        }
        if (this.type instanceof Class) {
            Class<?> componentType = ((Class<?>) this.type).getComponentType();
            return forType(componentType, this.variableResolver);
        }
        if (this.type instanceof GenericArrayType) {
            return forType(((GenericArrayType) this.type).getGenericComponentType(), this.variableResolver);
        }
        return resolveType().getComponentType();
    }
337921
public static <T> T[] toArray(Iterable<T> iterable, Class<T> componentType) {
		return toArray(CollectionUtil.toCollection(iterable), componentType);
	}
1331814
public static Object toPrimitiveArray(Object array) {
    if (!array.getClass().isArray()) {
      throw new IllegalArgumentException("Must give array object.");
    }
    if (isWrapperArray(array.getClass())) {
      int length = Array.getLength(array);
      Object newArray = Array.newInstance(toPrimitive(array.getClass().getComponentType()), length);
      for (int i = 0; i < length; i++) {
        Array.set(newArray, i, Array.get(array, i));
      }
      return newArray;
    } else if (array.getClass().getComponentType().isArray()) {
      int length = Array.getLength(array);
      Object newArray = Array.newInstance(toPrimitiveArray(array.getClass().getComponentType()), length);
      for (int i = 0; i < length; i++) {
        Array.set(newArray, i, toPrimitiveArray(Array.get(array, i)));
      }
      return newArray;
    }
    return array;
  }
615917
Class<?> getGenericType(Type type) {
        if (type instanceof ParameterizedType) {
            ParameterizedType pt = (ParameterizedType) type;
            Type[] ts = pt.getActualTypeArguments();
            if (ts.length == 1) {
                return (Class<?>) ts[0];
            }
        }
        Class<?> clazz = (Class<?>) type;
        if (clazz.isArray()) {
            return clazz.getComponentType();
        }
        return Object.class;
    }
233705
@GwtIncompatible("incompatible method")
    private static boolean arrayMemberEquals(final Class<?> componentType, final Object o1, final Object o2) {
        if (componentType.isAnnotation()) {
            return annotationArrayMemberEquals((Annotation[]) o1, (Annotation[]) o2);
        }
        if (componentType.equals(Byte.TYPE)) {
            return Arrays.equals((byte[]) o1, (byte[]) o2);
        }
        if (componentType.equals(Short.TYPE)) {
            return Arrays.equals((short[]) o1, (short[]) o2);
        }
        if (componentType.equals(Integer.TYPE)) {
            return Arrays.equals((int[]) o1, (int[]) o2);
        }
        if (componentType.equals(Character.TYPE)) {
            return Arrays.equals((char[]) o1, (char[]) o2);
        }
        if (componentType.equals(Long.TYPE)) {
            return Arrays.equals((long[]) o1, (long[]) o2);
        }
        if (componentType.equals(Float.TYPE)) {
            return Arrays.equals((float[]) o1, (float[]) o2);
        }
        if (componentType.equals(Double.TYPE)) {
            return Arrays.equals((double[]) o1, (double[]) o2);
        }
        if (componentType.equals(Boolean.TYPE)) {
            return Arrays.equals((boolean[]) o1, (boolean[]) o2);
        }
        return Arrays.equals((Object[]) o1, (Object[]) o2);
    }
750278
private static void checkArrayType(Class clazz) {
        if (null == clazz) {
            throw new IllegalArgumentException("clazz can not be null");
        }

        if (!clazz.isArray()) {
            throw new IllegalArgumentException(clazz.getCanonicalName() + " is not array type");
        }
    }
384390
private static Class getArrayBaseType(Class array) {
        while (array.isArray()) {
            array = array.getComponentType();
        }
        return array;
    }
503838
public boolean isArray() {
		if (type == null) {
			return false;
		}
		return type.isArray() || List.class.isAssignableFrom(type) || Set.class.isAssignableFrom(type);
	}
534097
public ResolvableType resolveType() {
        if (this.type instanceof ParameterizedType) {
            return forType(((ParameterizedType) this.type).getRawType(), this.variableResolver);
        }
        if (this.type instanceof WildcardType) {
            Type resolved = resolveBounds(((WildcardType) this.type).getUpperBounds());
            if (resolved == null) {
                resolved = resolveBounds(((WildcardType) this.type).getLowerBounds());
            }
            return forType(resolved, this.variableResolver);
        }
        if (this.type instanceof TypeVariable) {
            TypeVariable<?> variable = (TypeVariable<?>) this.type;
            // Try default variable resolution
            if (this.variableResolver != null) {
                ResolvableType resolved = this.variableResolver.resolveVariable(variable);
                if (resolved != null) {
                    return resolved;
                }
            }
            // Fallback to bounds
            return forType(resolveBounds(variable.getBounds()), this.variableResolver);
        }
        return NONE;
    }
388151
private Object convertArrayToArray(Object array) {
		final Class<?> valueComponentType = ArrayUtil.getComponentType(array);

		if (valueComponentType == targetComponentType) {
			return array;
		}

		final int len = ArrayUtil.length(array);
		final Object result = Array.newInstance(targetComponentType, len);

		final ConverterRegistry converter = ConverterRegistry.getInstance();
		for (int i = 0; i < len; i++) {
			Array.set(result, i, converter.convert(targetComponentType, Array.get(array, i)));
		}
		return result;
	}
36548
function readOnlyArrayOfType(thing: BabelAST) {
  return t.genericTypeAnnotation(
    t.identifier('$ReadOnlyArray'),
    t.typeParameterInstantiation([thing]),
  );
}
217512
public static Type getArrayComponentType(Type type) {
        if (type instanceof GenericArrayType) {
            return GenericArrayType.class.cast(type).getGenericComponentType();
        }
        if (type instanceof Class<?>) {
            Class<?> clazz = (Class<?>) type;
            if (clazz.isArray()) {
                return clazz.getComponentType();
            }
        }
        throw new IllegalArgumentException("Not an array type " + type);
    }
1300932
public Type[] getArrayIndexTypes() throws IntrospectionException {
        if (!mCheckedForArrayLookup) {
            checkForArrayLookup();
        }

        return mArrayIndexTypes == null ? null :
            (Type[])mArrayIndexTypes.clone();
    }
504958
@Override
	@Description("Gets all of th resource types which have bound Component Bindings Providers")
	public String[] getLoadedResourceTypes() {
		Set<String> types = ((ComponentBindingsProviderFactoryImpl) componentBindingsProviderFactory)
				.getLoadedResourceTypes();
		return types.toArray(new String[types.size()]);
	}
262618
public ResolvableType[] getInterfaces() {
		Class<?> resolved = resolve();
		if (resolved == null || ObjectUtils.isEmpty(resolved.getGenericInterfaces())) {
			return EMPTY_TYPES_ARRAY;
		}
		if (this.interfaces == null) {
			this.interfaces = forTypes(SerializableTypeWrapper.forGenericInterfaces(resolved),
					asVariableResolver());
		}
		return this.interfaces;
	}
999115
public Class<?> getArrayType(Class<?> clazz) {

        if (clazz.isArray()) {
            return getArrayType(clazz.getComponentType());
        }

        return clazz;
    }
63709
public static Type newArrayType(Type componentType) {
    if (componentType instanceof Class<?>) {
      return newArrayType((Class<?>) componentType);
    }
    final TypeVariable<?> var = TypeVariableGenerator.freshTypeVariable("E");
    return new TypeResolver().where(var, componentType).resolveType(new GenericArrayType() {
      @Override public Type getGenericComponentType() { return var; }
    });
  }