Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8808833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:43:14+00:00 2026-06-14T02:43:14+00:00

I have query string like that: ObjectGUId=1abcde&ObjectType=2&ObjectTitle=maximumoflife&Content=racroi&TimeStamp=2012-11-05T17:20:06.056 And I have Java Object: LogObject{ private

  • 0

I have query string like that:

ObjectGUId=1abcde&ObjectType=2&ObjectTitle=maximumoflife&Content=racroi&TimeStamp=2012-11-05T17:20:06.056

And I have Java Object:

LogObject{
    private String ObjectGUId;
    private String ObjectType;
    private String ObjectTitle;
    private String Content;
    private String TimeStamp;
}

So i want to parse this query string to this java Object.

I’ve searched and read many question but not gotten correct answer yet.

Show me what can solve this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:43:16+00:00Added an answer on June 14, 2026 at 2:43 am

    Etiquette

    1. You really should be much more specific about what you have tried and why it didn’t work.

    2. A proper code sample of your LogObject would really be very helpful here.

    3. Ideally, you would provide a SSCCE so others could easily test your problem themselves.

    Answer

    You can extract the name:value pairs like this:

    String toParse = "ObjectGUId=1abcde&ObjectType=2&ObjectTitle=maximumoflife&Content=racroi&TimeStamp=2012-11-05T17:20:06.056";
    String[] fields = toParse.split("&");
    String[] kv;
    
    HashMap<String, String> things = new HashMap<String, String>();
    
    
    for (int i = 0; i < fields.length; ++i)
    {
        t = fields[i].split("=");
        if (2 == kv.length)
        {
            things.put(kv[0], kv[1]); 
        }
    }
    

    I have chosen to put them into a HashMap, but you could just as easily look at the name part (kv[0]) and choose to do something with it. For example:

    if kv[0].equals("ObjectGUId")
    {
        logObject.setGUId(kv[1]); // example mutator/setter method
    }
    else if //...
    

    However, all your fields in LogObject are private and you haven’t shown us any methods, so I hope you have some way of setting them from outside… bear in mind you will need to store the pairs in a data structure of some kind (as I have done with a HashMap) if you intend to intialise a LogObject with all the fields rather than setting the fields after a constructor call.

    Speaking of SSCCEs, I made one for this answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say, we have a query string that looks like this: param1:'test1' && param2:'test2' I
I have a query string that contains a variable like this $field_name = 'features';
i have a string like this: blablablamorecontentblablabla?name=michel&score=5&age=28&iliedabouttheage=true looks like a regular query string yes,
I have a url of a type where query string is like this... ?
If I have a query like this: String Category = HttpContext.Current.Request.QueryString[Product].ToString(); IQueryable<ItemFile> pressReleases =
I have a query string: a=1&b=2&c[1]=3&c[2]=4 etc… I want a NSDictionary where a =>
I have a dynamic query string that I need to pass via an .htaccess
I have a string like a=6&id=99 (i might store it in html as 'a=6&id=99'
this may seem like a stupid question but I have a query string which
I have a database (MS SQL) with a column that contains a query string.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.