Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27491

Re: Unable to Overload toString for Object

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From markspace <markspace@nospam.nospam>
Newsgroups comp.lang.java.programmer
Subject Re: Unable to Overload toString for Object
Date Wed, 12 Feb 2014 10:37:00 -0800
Organization A noiseless patient Spider
Lines 32
Message-ID <ldgf0i$quu$1@dont-email.me> (permalink)
References <705891c8-b170-44c0-866f-48eec7b38c4d@googlegroups.com> <a4GdnaxRH4JrfGTPnZ2dnUVZ8vednZ2d@giganews.com> <1138f80c-bc7c-4edd-a91b-fb5f8e2137d6@googlegroups.com> <afa4179b-ea47-4bc4-b9d3-a3a4e7df06bf@googlegroups.com> <0163eae2-3f35-4b96-a292-87a2fe3d3b03@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 12 Feb 2014 18:37:06 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="27614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/u2TcpYoalpbLzKiQrDk1xP5lw8mK6SHo="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <0163eae2-3f35-4b96-a292-87a2fe3d3b03@googlegroups.com>
Cancel-Lock sha1:YHl6tMSv4rlvQGaRDevwlV5kpfE=
Xref csiph.com comp.lang.java.programmer:27491

Show key headers only | View raw


On 2/12/2014 12:38 AM, Ojesh Dugar wrote:
> Basically, I am able to access Bugzilla Webservice API through java
> code(xmlrpc) and in return i get a object of <<class
> java.util.HashMap>>. According to Bugzilla documentation two items
> are returned, bugs and faults, both are array of hashes and I want to
> access these. Thanks.
>


Cast to a HashMap and iterate over all of its keys.

(not tested):

// 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 )
                 );
   }

More info here:

http://www.mkyong.com/java/how-to-loop-a-map-in-java/

	

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-10 22:59 -0800
  Re: Unable to Overload toString for Object leif.roar@invalid.com (Leif Roar Moldskred) - 2014-02-11 02:40 -0600
    Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-11 01:03 -0800
      Re: Unable to Overload toString for Object Lew <lewbloch@gmail.com> - 2014-02-11 15:49 -0800
        Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-12 00:38 -0800
          Re: Unable to Overload toString for Object markspace <markspace@nospam.nospam> - 2014-02-12 10:37 -0800
            Re: Unable to Overload toString for Object Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-02-12 13:57 -0500
              Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-12 20:24 -0800
                Re: Unable to Overload toString for Object Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-02-13 08:29 -0500
            Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-12 20:58 -0800
              Re: Unable to Overload toString for Object markspace <markspace@nospam.nospam> - 2014-02-12 21:29 -0800
                Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-13 00:59 -0800
  Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-11 01:06 -0800
    Re: Unable to Overload toString for Object Ojesh Dugar <ojesh.u@gmail.com> - 2014-02-11 01:27 -0800

csiph-web