/** * Create a new {@link List} TupleSlot, with the supplied name and element type. * @param name The name of the TupleSlot. * @param elementType The element type of the TupleSlot. * @return The created TupleSlot. */ public static <T> TupleSlot ofList(String name, Class<T> elementType) { if (elementType == null) throw new IllegalArgumentException("elementType must not be null"); return of(name, Types.listOf(elementType)); }
/** * Create a new {@link Map} TupleSlot, with the supplied name and key and value types. * @param name The name of the TupleSlot. * @param keyType The key type of the TupleSlot. * @param valueType The value type of the TupleSlot. * @return The created TupleSlot. */ public static <K, V> TupleSlot ofMap(String name, Class<K> keyType, Class<V> valueType) { if (keyType == null) throw new IllegalArgumentException("keyType must not be null"); if (valueType == null) throw new IllegalArgumentException("valueType must not be null"); return of(name, Types.mapOf(keyType, valueType)); }
/** * Create a new {@link Optional} TupleSlot, with the supplied name and value type. * @param name The name of the TupleSlot. * @param valueType The value type of the TupleSlot. * @return The created TupleSlot. */ public static <T> TupleSlot ofOptional(String name, Class<T> valueType) { if (valueType == null) throw new IllegalArgumentException("valueType must not be null"); return of(name, Types.optionalOf(valueType)); }