@@ -48,17 +48,29 @@ private OpRefTransformUtils() {
4848
4949 /**
5050 * Attempts to perform "unlift" transformation of the specified
51- * {@link OpRef} if it matches the specified classes. Otherwise, null is
52- * returned, indicating that transformation is not possible.
51+ * {@link OpRef} if it matches the specified classes. Otherwise null is
52+ * returned, indicating that transformation is not possible. If no indices
53+ * are given, all types will be unlifted.
5354 *
54- * @param toRef the ref to transform
55- * @param rawSearchClass the functional raw type to look for
56- * @param unliftRawClass the raw type of types to unlift
55+ * @param toRef
56+ * the ref to transform
57+ * @param rawSearchClass
58+ * the functional raw type to look for
59+ * @param unliftRawClass
60+ * the raw type of types to unlift
61+ * @param typeArgumentIndices
62+ * the indices of type arguments of the functional refTypes to unlift
63+ * @param argIndices
64+ * the indices of arg types of the ref to unlift
65+ * @param outputIndices
66+ * the indices of output types of the ref to unlift
5767 * @return
5868 */
59- public static OpRef unliftTransform (OpRef toRef , Class <?> rawSearchClass , Class <?> unliftRawClass ) {
69+ public static OpRef unliftTransform (OpRef toRef , Class <?> rawSearchClass , Class <?> unliftRawClass ,
70+ Integer [] typeArgumentIndices , Integer [] argIndices , Integer [] outputIndices ) {
6071 Type [] refTypes = toRef .getTypes ();
61- boolean typesChanged = TypeModUtils .unliftParameterizedTypes (refTypes , rawSearchClass , unliftRawClass );
72+ boolean typesChanged = TypeModUtils .unliftParameterizedTypes (refTypes , rawSearchClass , unliftRawClass ,
73+ typeArgumentIndices );
6274 // TODO We assume here that the functional input is the first Type in
6375 // this list and all others are secondary args if there are any (we do
6476 // not want to touch them as they are not part of op transformations).
@@ -67,9 +79,9 @@ public static OpRef unliftTransform(OpRef toRef, Class<?> rawSearchClass, Class<
6779 // need to be requested first and are thus at the beginning of the list.
6880 // From the functional type we know how many there must be.
6981 Type [] args = toRef .getArgs ();
70- boolean argsChanged = TypeModUtils .unliftTypes (args , unliftRawClass );
82+ boolean argsChanged = TypeModUtils .unliftTypes (args , unliftRawClass , argIndices );
7183 Type [] outs = toRef .getOutTypes ();
72- boolean outsChanged = TypeModUtils .unliftTypes (outs , unliftRawClass );
84+ boolean outsChanged = TypeModUtils .unliftTypes (outs , unliftRawClass , outputIndices );
7385
7486 if (typesChanged && argsChanged && outsChanged ) {
7587 return OpRef .fromTypes (toRef .getName (), refTypes , outs , args );
0 commit comments