I have multilevel map like :

def someMap = [gen:[type:all], 
 build:[time:6, 
    types:[
      TypeA:[type1:[a:true, b:false, c:true, d:true, e:true], 
             type2:[a:true, b:false, c:true, d:true, e:true]], 
      TypeB:[type1:[a:true, b:false, c:true, d:true, e:true]
             type2:[a:true, b:false, c:true, d:true, e:true]], 
      TypeC:[type1:[a:true, b:false, c:true, d:true, e:true],
             type2:[a:true, b:false, c:true, d:true, e:true]]]]


 I want to remove the some entries from it, say "TypeA" and "TypeB" from 
map *but with Jenkins groovy script I am not able to do so*, with normal 
groovy, i can delete entries with removeAll() or with iterator, Below 
things already tried.

someMap.build.types.keySet().removeAll(['TypeA', 'TypeB', 
'TypeC'].minus('TypeC')))

def iterator = someMap.build.types.entrySet().iterator()
while (iterator.hasNext()) {
  if (iterator.next().key != 'TypeC' ) {
    iterator.remove()
  }
}


but i get the original map with no element removed.



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/34335973-a068-43db-abef-e3e1d986965f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to