/** * Returns type information for Java arrays of object types (such as <code>String[]</code>, * <code>Integer[]</code>). The array itself must not be null. Null values for elements are supported. * * @param elementType element type of the array */ @SuppressWarnings("unchecked") public static <E> TypeInformation<E[]> OBJECT_ARRAY(TypeInformation<E> elementType) { if (elementType == Types.STRING) { return (TypeInformation) BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO; } return ObjectArrayTypeInfo.getInfoFor(elementType); }
@Override protected ObjectArrayTypeInfo<?, ?>[] getTestData() { return new ObjectArrayTypeInfo<?, ?>[] { ObjectArrayTypeInfo.getInfoFor(TestClass[].class, new GenericTypeInfo<>(TestClass.class)), ObjectArrayTypeInfo.getInfoFor(TestClass[].class, new PojoTypeInfo<>(TestClass.class, new ArrayList<PojoField>())) }; }
TypeInformation<?> elementType = schemaToTypeInfo(elementSchema); return ObjectArrayTypeInfo.getInfoFor(elementType); case MAP: TypeDescription keySchema = schema.getChildren().get(0);
Class<OUT> classArray = (Class<OUT>) (java.lang.reflect.Array.newInstance(componentClass, 0).getClass()); return ObjectArrayTypeInfo.getInfoFor(classArray, componentInfo);
@Test public void testObjectArrayKeyRejection() { KeySelector<Tuple2<Integer[], String>, Object[]> keySelector = new KeySelector<Tuple2<Integer[], String>, Object[]>() { @Override public Object[] getKey(Tuple2<Integer[], String> value) throws Exception { Object[] ks = new Object[value.f0.length]; for (int i = 0; i < ks.length; i++) { ks[i] = new Object(); } return ks; } }; ObjectArrayTypeInfo<Object[], Object> keyTypeInfo = ObjectArrayTypeInfo.getInfoFor( Object[].class, new GenericTypeInfo<>(Object.class)); testKeyRejection(keySelector, keyTypeInfo); }
in2Type); return ObjectArrayTypeInfo.getInfoFor(clazz, componentTypeInfo);
/** * Returns type information for Java arrays of object types (such as <code>String[]</code>, * <code>Integer[]</code>). The array itself must not be null. Null values for elements are supported. * * @param elementType element type of the array */ @SuppressWarnings("unchecked") public static <E> TypeInformation<E[]> OBJECT_ARRAY(TypeInformation<E> elementType) { if (elementType == Types.STRING) { return (TypeInformation) BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO; } return ObjectArrayTypeInfo.getInfoFor(elementType); }
/** * Returns type information for Java arrays of object types (such as <code>String[]</code>, * <code>Integer[]</code>). The array itself must not be null. Null values for elements are supported. * * @param elementType element type of the array */ @SuppressWarnings("unchecked") public static <E> TypeInformation<E[]> OBJECT_ARRAY(TypeInformation<E> elementType) { if (elementType == Types.STRING) { return (TypeInformation) BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO; } return ObjectArrayTypeInfo.getInfoFor(elementType); }
arrayInfo = ObjectArrayTypeInfo.getInfoFor(loadClass("[L" + returnType.getTypeClass().getName() + ";"), returnType); for (int i = 1; i < arrayDimensionCount; i++) { arrayPrefix += "["; arrayInfo = ObjectArrayTypeInfo.getInfoFor(loadClass(arrayPrefix + "L" + returnType.getTypeClass().getName() + ";"), arrayInfo);
in2Type); return ObjectArrayTypeInfo.getInfoFor(clazz, componentTypeInfo);
in2Type); return ObjectArrayTypeInfo.getInfoFor(clazz, componentTypeInfo);
Class<OUT> classArray = (Class<OUT>) (java.lang.reflect.Array.newInstance(componentClass, 0).getClass()); return ObjectArrayTypeInfo.getInfoFor(classArray, componentInfo);
Class<OUT> classArray = (Class<OUT>) (java.lang.reflect.Array.newInstance(componentClass, 0).getClass()); return ObjectArrayTypeInfo.getInfoFor(classArray, componentInfo);
new org.apache.flink.api.java.typeutils.TupleTypeInfo<>( new TupleTypeInfo(Fields.UNKNOWN), ObjectArrayTypeInfo.getInfoFor(new TupleTypeInfo(Fields.UNKNOWN)) );