I've got a problem with lists in groovy, I have the following inputs to my script
My requirement is to put my inputs into a list like the following example provided by a user here:
final int OID = 0
final int TASK = 1
final int START = 2
final int END = 3
final int REALSTART = 4
final int REALEND = 5
List<Object[]> input = [
[ 'oid', 'task', 10, 20, 11, 25 ],
[ 'oid2', 'task2', 25, 50, null, null ]
]
List<List> output = [ ]
input.each { row ->
output << [ row[ OID ], row[ TASK ], row[ START ], row[ END ] ]
if ( row[ REALSTART ] && row[ REALEND ] ) {
output << [ row[ OID ], row[ TASK ] + '_Real', row[ REALSTART ], row[ REALEND ] ]
}
}
My problem is the input list part, I can't figure how to fill it like the example so that my input list result is:
[oid1,task1,start1,end1,realstart1,realend1]
[oid2,task2,start2,end2,realstart2,realend2]
[oid3,task3,start3,end3,realstart3,realend3]
[oid4,task4,start4,end4,realstart4,realend4]
[oid5,task5,start5,end5,realstart5,realend5]
with my given input values. timeNow is irrelevant in this case.
Is it clear enough?

[oid1,task1,start1,end1,realstart1,realend1]format but what does it look like intially?List<int> oid, List<String> task, List<Timestamp> startand so on. So it's a list for each attribute. Imagine those are arrays, i need to have my output like:{ oid[0],task[0],start[0]...}{ oid[1],task[1],start[1]..} ..