I have json array ob object list name of array is value in this array i have on inside value object i have another object called filed i want access filed object and find duplicate any help?. Update: i used System.out.println("a : " + Collections.frequency(stringList, "Accounts Receivable")); method but its give me 0 always
{
"",
"value": [
{
"@odata.etag": """,
"createdDateTime": "",
"eTag": """,
"id": "",
"lastModifiedDateTime": "",
"webUrl": "",
"createdBy": {
"user": {
"email": "",
"id": "",
"displayName": ""
}
},
"lastModifiedBy": {
"user": {
"email": ",
"id": "",
"displayName": ""
}
},
"parentReference": {},
"contentType": {
"id": ""
},
"fields@odata.context": "",
"fields": {
"@odata.etag": """,
"id": "",
"ContentType": "",
"Modified": "",
"Created": "",
"AuthorLookupId": "",
"EditorLookupId": "",
"_UIVersionString": "",
"Attachments": false,
"Edit": "",
"ItemChildCount": "0",
"FolderChildCount": "0",
"_ComplianceFlags": "",
"_ComplianceTag": "",
"_ComplianceTagWrittenTime": "",
"_ComplianceTagUserId": "",
"JobCategory": "",--> "check this value for duplicate"
"Competency": "",
"Level": "",
"CompetencyType": "",
"Index": "0",
"FormID@odata.type": "",
"FormID": 25
}
}]
in side value array list there is fields object but while trying its given only object here is my Code.
Set<Example> uniqueSet = new HashSet<Example>(borrowModelList);
for (Example temp : uniqueSet) {
txtInfo.setText(String.valueOf(Collections.frequency(borrowModelList,temp.getValue().get(0).getFields())));
textInfoOne.setText(String.valueOf(Collections.frequency(borrowModelList,temp.getValue().get(0).getFields())));
textInfoTwo.setText(String.valueOf(Collections.frequency(borrowModelList,temp.getValue().get(0).getFields())));
textInfoThree.setText(String.valueOf(Collections.frequency(borrowModelList,temp.getValue().get(0).getFields())));
textInfoFour.setText(String.valueOf(Collections.frequency(borrowModelList,temp.getValue().get(0).getFields())));
}
I/System.out: 1 in side field object there is JobCategory field i want to check only and show on textview.