On 2/12/2014 8:58 PM, Ojesh Dugar wrote:
According to documentation, bugs- is an array of hashes that contains
information about the bugs with the valid ids. Each hash contains the
following items
It sounds to me like the first property, with a key "bugs" is an array,
probably of HashMap (or possibly just Map), which contains a the actual
bug information.
The chance that I'm going to mess something up here is increasing
because I'm not compiling this, but try this.
// create bug
Object createResult = rpcClient.execute("Bug.search", new
Object[]{bugMap});
//createResult.toString();
HashMap bugs = (HashMap)createResult;
for( Object key : bugs.keySet() ) {
System.out.println( "Key "+key.getClass().getName()
+ "= "+key
+ ", value "+ bugs.get( key ).getClass().getName()
+ "= "+ bugs.get( key )
);
Object value = bugs.get( key );
if( value instanceof Object[] ) {
Object[] valueArray = (Object[])value;
for( Object v : valueArray ) {
System.out.println( "-- "+v.getClass().getName() );
}
} else System.out.println( "not an array!" );
}
You should be able to run this and determine what to replace the
v.getClass().getName() part with; probably a cast to a Map. I don't
recall if collections normally override their to string -- they might,
though the result normally isn't very pretty.
Yeah, This worked out for me.
That was a great help. Thanks a lot.