-2
{
    "errorCode": 200,
    "opMessage": {
        "personalDetails": {
            "dob": {
                "mm": 2,
                "dd": 2,
                "yyyy": 1975
            },
            "name": {
                "fname": "sai gampa",
                "lName": "krishna"
            },
            "maritalStatus": "Single",
            "ssn": "123-45-7777"
        },
        "id": "0101",
        "contactDetails": {
            "address": [
                {
                    "isPrimary": true,
                    "id": "HOME;2017-06-30",
                    "type": "Home",
                    "addr": {
                        "country": "USA",
                        "addr2": "W 24th St",
                        "addr1": "518",
                        "city": "New York",
                        "postalCode": "11122",
                        "state": "NY"
                    }
                },
                {
                    "isPrimary": false,
                    "id": "BUSN;2017-07-04",
                    "type": "Work",
                    "addr": {
                        "country": "USA",
                        "addr2": "Agsuaiajs",
                        "addr1": "Qwertyy",
                        "city": "Shshshsjsj",
                        "postalCode": "71899",
                        "state": "CO"
                    }
                }
            ],
            "bestWayToContact": "Phone",
            "ph": [
                {
                    "isPrimary": false,
                    "num": "666-666-6666",
                    "id": "Work",
                    "type": "Work"
                },
                {
                    "isPrimary": false,
                    "num": "444-444-4444",
                    "id": "Cell",
                    "type": "Cell"
                },
                {
                    "isPrimary": true,
                    "num": "111-111-1111",
                    "id": "Home",
                    "type": "Home"
                }
            ],
            "eMail": [
                {
                    "isPrimary": true,
                    "id": "HOME",
                    "addr": "[email protected]"
                }
            ]
        }
    }
}
3
  • Lets say I want to extract eMail array of objects Commented Jul 5, 2017 at 11:01
  • 1
    please edit don't comment Commented Jul 5, 2017 at 11:05
  • Just deserialize it using a json deserializer. There are plenty of examples around the net. Commented Jul 5, 2017 at 11:05

1 Answer 1

0

HashMap has a method called entrySet(). With entrySet() you can get all the entries in the hashmap.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm not into coding. can you just mention the code that I should write to extract the email array

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.