I am not able to access data as per POJO class











up vote
-2
down vote

favorite












Hi I have following json response, I am not able to access data of 'edit' jsonobject, how to create pojo for that?



Example



{
"result":"",
"responseMessage":"",
"edit":{
"id":"156",
"user_id":"5466",

},
"data":[
{
"dataid":"1",
"dataname":"tt"
},
{
"dataid":"2",
"dataname":"tt"
}
]
}


How to create pojo class for this response










share|improve this question




















  • 1




    Please post the code you have so far so we can best help you.
    – Sub 6 Resources
    Nov 22 at 5:33






  • 2




    if you are having trouble creating pojo class by your own use this website jsonschema2pojo
    – Kevin Kurien
    Nov 22 at 5:34












  • @Sub6Resources just help me with pojo class, i have created one but can you tell how to access data of edit json object.
    – Nilima
    Nov 22 at 5:35










  • Always use JsonValidator for checking that your json is valid or not.
    – Piyush
    Nov 22 at 5:54






  • 1




    Possible duplicate of How do I parse JSON in Android?
    – Vladyslav Matviienko
    Nov 22 at 6:16















up vote
-2
down vote

favorite












Hi I have following json response, I am not able to access data of 'edit' jsonobject, how to create pojo for that?



Example



{
"result":"",
"responseMessage":"",
"edit":{
"id":"156",
"user_id":"5466",

},
"data":[
{
"dataid":"1",
"dataname":"tt"
},
{
"dataid":"2",
"dataname":"tt"
}
]
}


How to create pojo class for this response










share|improve this question




















  • 1




    Please post the code you have so far so we can best help you.
    – Sub 6 Resources
    Nov 22 at 5:33






  • 2




    if you are having trouble creating pojo class by your own use this website jsonschema2pojo
    – Kevin Kurien
    Nov 22 at 5:34












  • @Sub6Resources just help me with pojo class, i have created one but can you tell how to access data of edit json object.
    – Nilima
    Nov 22 at 5:35










  • Always use JsonValidator for checking that your json is valid or not.
    – Piyush
    Nov 22 at 5:54






  • 1




    Possible duplicate of How do I parse JSON in Android?
    – Vladyslav Matviienko
    Nov 22 at 6:16













up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











Hi I have following json response, I am not able to access data of 'edit' jsonobject, how to create pojo for that?



Example



{
"result":"",
"responseMessage":"",
"edit":{
"id":"156",
"user_id":"5466",

},
"data":[
{
"dataid":"1",
"dataname":"tt"
},
{
"dataid":"2",
"dataname":"tt"
}
]
}


How to create pojo class for this response










share|improve this question















Hi I have following json response, I am not able to access data of 'edit' jsonobject, how to create pojo for that?



Example



{
"result":"",
"responseMessage":"",
"edit":{
"id":"156",
"user_id":"5466",

},
"data":[
{
"dataid":"1",
"dataname":"tt"
},
{
"dataid":"2",
"dataname":"tt"
}
]
}


How to create pojo class for this response







android getter-setter pojo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 10:56









AwaisMajeed

657219




657219










asked Nov 22 at 5:29









Nilima

307




307








  • 1




    Please post the code you have so far so we can best help you.
    – Sub 6 Resources
    Nov 22 at 5:33






  • 2




    if you are having trouble creating pojo class by your own use this website jsonschema2pojo
    – Kevin Kurien
    Nov 22 at 5:34












  • @Sub6Resources just help me with pojo class, i have created one but can you tell how to access data of edit json object.
    – Nilima
    Nov 22 at 5:35










  • Always use JsonValidator for checking that your json is valid or not.
    – Piyush
    Nov 22 at 5:54






  • 1




    Possible duplicate of How do I parse JSON in Android?
    – Vladyslav Matviienko
    Nov 22 at 6:16














  • 1




    Please post the code you have so far so we can best help you.
    – Sub 6 Resources
    Nov 22 at 5:33






  • 2




    if you are having trouble creating pojo class by your own use this website jsonschema2pojo
    – Kevin Kurien
    Nov 22 at 5:34












  • @Sub6Resources just help me with pojo class, i have created one but can you tell how to access data of edit json object.
    – Nilima
    Nov 22 at 5:35










  • Always use JsonValidator for checking that your json is valid or not.
    – Piyush
    Nov 22 at 5:54






  • 1




    Possible duplicate of How do I parse JSON in Android?
    – Vladyslav Matviienko
    Nov 22 at 6:16








1




1




Please post the code you have so far so we can best help you.
– Sub 6 Resources
Nov 22 at 5:33




Please post the code you have so far so we can best help you.
– Sub 6 Resources
Nov 22 at 5:33




2




2




if you are having trouble creating pojo class by your own use this website jsonschema2pojo
– Kevin Kurien
Nov 22 at 5:34






if you are having trouble creating pojo class by your own use this website jsonschema2pojo
– Kevin Kurien
Nov 22 at 5:34














@Sub6Resources just help me with pojo class, i have created one but can you tell how to access data of edit json object.
– Nilima
Nov 22 at 5:35




@Sub6Resources just help me with pojo class, i have created one but can you tell how to access data of edit json object.
– Nilima
Nov 22 at 5:35












Always use JsonValidator for checking that your json is valid or not.
– Piyush
Nov 22 at 5:54




Always use JsonValidator for checking that your json is valid or not.
– Piyush
Nov 22 at 5:54




1




1




Possible duplicate of How do I parse JSON in Android?
– Vladyslav Matviienko
Nov 22 at 6:16




Possible duplicate of How do I parse JSON in Android?
– Vladyslav Matviienko
Nov 22 at 6:16












3 Answers
3






active

oldest

votes

















up vote
1
down vote



accepted










You can use this link to create POJO classes for your JSON in future. However your JSON is also not valid, it contains an extra , in your edit object.



"edit":{
"id":"156",
"user_id":"5466",<--This comma

}





share|improve this answer




























    up vote
    1
    down vote













    your Json is incorrect. There is an extra "," inside edit object. Remove that and try accessing data of edit



    Still if you are unable to access, I am attaching following POJO for you to use.



    public class ExPojo
    {
    private String responseMessage;

    private String result;

    private Data data;

    private Edit edit;

    public String getResponseMessage ()
    {
    return responseMessage;
    }

    public void setResponseMessage (String responseMessage)
    {
    this.responseMessage = responseMessage;
    }

    public String getResult ()
    {
    return result;
    }

    public void setResult (String result)
    {
    this.result = result;
    }

    public Data getData ()
    {
    return data;
    }

    public void setData (Data data)
    {
    this.data = data;
    }

    public Edit getEdit ()
    {
    return edit;
    }

    public void setEdit (Edit edit)
    {
    this.edit = edit;
    }

    @Override
    public String toString()
    {
    return "ClassPojo [responseMessage = "+responseMessage+", result = "+result+", data = "+data+", edit = "+edit+"]";
    }
    }


    Hope this helps.






    share|improve this answer





















    • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
      – Vladyslav Matviienko
      Nov 22 at 6:09










    • thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
      – Nilima
      Nov 22 at 9:23










    • you can just cast that value to int like, (int) price
      – Chandrani Chatterjee
      Nov 22 at 12:08


















    up vote
    -1
    down vote













    make pojo class like this way..



    public class DataItem{

    @SerializedName("dataid")
    private String dataid;

    @SerializedName("dataname")
    private String dataname;

    public void setDataid(String dataid){
    this.dataid = dataid;
    }

    public String getDataid(){
    return dataid;
    }

    public void setDataname(String dataname){
    this.dataname = dataname;
    }

    public String getDataname(){
    return dataname;
    }

    @Override
    public String toString(){
    return
    "DataItem{" +
    "dataid = '" + dataid + ''' +
    ",dataname = '" + dataname + ''' +
    "}";
    }
    }


    public class Edit{

    @SerializedName("user_id")
    private String userId;

    @SerializedName("id")
    private String id;

    public void setUserId(String userId){
    this.userId = userId;
    }

    public String getUserId(){
    return userId;
    }

    public void setId(String id){
    this.id = id;
    }

    public String getId(){
    return id;
    }

    @Override
    public String toString(){
    return
    "Edit{" +
    "user_id = '" + userId + ''' +
    ",id = '" + id + ''' +
    "}";
    }
    }


    public class Response{

    @SerializedName("result")
    private String result;

    @SerializedName("data")
    private List<DataItem> data;

    @SerializedName("edit")
    private Edit edit;

    @SerializedName("responseMessage")
    private String responseMessage;

    public void setResult(String result){
    this.result = result;
    }

    public String getResult(){
    return result;
    }

    public void setData(List<DataItem> data){
    this.data = data;
    }

    public List<DataItem> getData(){
    return data;
    }

    public void setEdit(Edit edit){
    this.edit = edit;
    }

    public Edit getEdit(){
    return edit;
    }

    public void setResponseMessage(String responseMessage){
    this.responseMessage = responseMessage;
    }

    public String getResponseMessage(){
    return responseMessage;
    }

    @Override
    public String toString(){
    return
    "Response{" +
    "result = '" + result + ''' +
    ",data = '" + data + ''' +
    ",edit = '" + edit + ''' +
    ",responseMessage = '" + responseMessage + ''' +
    "}";
    }
    }


    Generate pojo class used Robopojo plugin.






    share|improve this answer





















    • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
      – Vladyslav Matviienko
      Nov 22 at 6:09











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424414%2fi-am-not-able-to-access-data-as-per-pojo-class%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    You can use this link to create POJO classes for your JSON in future. However your JSON is also not valid, it contains an extra , in your edit object.



    "edit":{
    "id":"156",
    "user_id":"5466",<--This comma

    }





    share|improve this answer

























      up vote
      1
      down vote



      accepted










      You can use this link to create POJO classes for your JSON in future. However your JSON is also not valid, it contains an extra , in your edit object.



      "edit":{
      "id":"156",
      "user_id":"5466",<--This comma

      }





      share|improve this answer























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        You can use this link to create POJO classes for your JSON in future. However your JSON is also not valid, it contains an extra , in your edit object.



        "edit":{
        "id":"156",
        "user_id":"5466",<--This comma

        }





        share|improve this answer












        You can use this link to create POJO classes for your JSON in future. However your JSON is also not valid, it contains an extra , in your edit object.



        "edit":{
        "id":"156",
        "user_id":"5466",<--This comma

        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 at 5:41









        AwaisMajeed

        657219




        657219
























            up vote
            1
            down vote













            your Json is incorrect. There is an extra "," inside edit object. Remove that and try accessing data of edit



            Still if you are unable to access, I am attaching following POJO for you to use.



            public class ExPojo
            {
            private String responseMessage;

            private String result;

            private Data data;

            private Edit edit;

            public String getResponseMessage ()
            {
            return responseMessage;
            }

            public void setResponseMessage (String responseMessage)
            {
            this.responseMessage = responseMessage;
            }

            public String getResult ()
            {
            return result;
            }

            public void setResult (String result)
            {
            this.result = result;
            }

            public Data getData ()
            {
            return data;
            }

            public void setData (Data data)
            {
            this.data = data;
            }

            public Edit getEdit ()
            {
            return edit;
            }

            public void setEdit (Edit edit)
            {
            this.edit = edit;
            }

            @Override
            public String toString()
            {
            return "ClassPojo [responseMessage = "+responseMessage+", result = "+result+", data = "+data+", edit = "+edit+"]";
            }
            }


            Hope this helps.






            share|improve this answer





















            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09










            • thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
              – Nilima
              Nov 22 at 9:23










            • you can just cast that value to int like, (int) price
              – Chandrani Chatterjee
              Nov 22 at 12:08















            up vote
            1
            down vote













            your Json is incorrect. There is an extra "," inside edit object. Remove that and try accessing data of edit



            Still if you are unable to access, I am attaching following POJO for you to use.



            public class ExPojo
            {
            private String responseMessage;

            private String result;

            private Data data;

            private Edit edit;

            public String getResponseMessage ()
            {
            return responseMessage;
            }

            public void setResponseMessage (String responseMessage)
            {
            this.responseMessage = responseMessage;
            }

            public String getResult ()
            {
            return result;
            }

            public void setResult (String result)
            {
            this.result = result;
            }

            public Data getData ()
            {
            return data;
            }

            public void setData (Data data)
            {
            this.data = data;
            }

            public Edit getEdit ()
            {
            return edit;
            }

            public void setEdit (Edit edit)
            {
            this.edit = edit;
            }

            @Override
            public String toString()
            {
            return "ClassPojo [responseMessage = "+responseMessage+", result = "+result+", data = "+data+", edit = "+edit+"]";
            }
            }


            Hope this helps.






            share|improve this answer





















            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09










            • thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
              – Nilima
              Nov 22 at 9:23










            • you can just cast that value to int like, (int) price
              – Chandrani Chatterjee
              Nov 22 at 12:08













            up vote
            1
            down vote










            up vote
            1
            down vote









            your Json is incorrect. There is an extra "," inside edit object. Remove that and try accessing data of edit



            Still if you are unable to access, I am attaching following POJO for you to use.



            public class ExPojo
            {
            private String responseMessage;

            private String result;

            private Data data;

            private Edit edit;

            public String getResponseMessage ()
            {
            return responseMessage;
            }

            public void setResponseMessage (String responseMessage)
            {
            this.responseMessage = responseMessage;
            }

            public String getResult ()
            {
            return result;
            }

            public void setResult (String result)
            {
            this.result = result;
            }

            public Data getData ()
            {
            return data;
            }

            public void setData (Data data)
            {
            this.data = data;
            }

            public Edit getEdit ()
            {
            return edit;
            }

            public void setEdit (Edit edit)
            {
            this.edit = edit;
            }

            @Override
            public String toString()
            {
            return "ClassPojo [responseMessage = "+responseMessage+", result = "+result+", data = "+data+", edit = "+edit+"]";
            }
            }


            Hope this helps.






            share|improve this answer












            your Json is incorrect. There is an extra "," inside edit object. Remove that and try accessing data of edit



            Still if you are unable to access, I am attaching following POJO for you to use.



            public class ExPojo
            {
            private String responseMessage;

            private String result;

            private Data data;

            private Edit edit;

            public String getResponseMessage ()
            {
            return responseMessage;
            }

            public void setResponseMessage (String responseMessage)
            {
            this.responseMessage = responseMessage;
            }

            public String getResult ()
            {
            return result;
            }

            public void setResult (String result)
            {
            this.result = result;
            }

            public Data getData ()
            {
            return data;
            }

            public void setData (Data data)
            {
            this.data = data;
            }

            public Edit getEdit ()
            {
            return edit;
            }

            public void setEdit (Edit edit)
            {
            this.edit = edit;
            }

            @Override
            public String toString()
            {
            return "ClassPojo [responseMessage = "+responseMessage+", result = "+result+", data = "+data+", edit = "+edit+"]";
            }
            }


            Hope this helps.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 22 at 5:37









            Chandrani Chatterjee

            309215




            309215












            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09










            • thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
              – Nilima
              Nov 22 at 9:23










            • you can just cast that value to int like, (int) price
              – Chandrani Chatterjee
              Nov 22 at 12:08


















            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09










            • thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
              – Nilima
              Nov 22 at 9:23










            • you can just cast that value to int like, (int) price
              – Chandrani Chatterjee
              Nov 22 at 12:08
















            It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
            – Vladyslav Matviienko
            Nov 22 at 6:09




            It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
            – Vladyslav Matviienko
            Nov 22 at 6:09












            thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
            – Nilima
            Nov 22 at 9:23




            thanks for help +1. and I am getting price like 1.000000 and i want to display 1. how to do that
            – Nilima
            Nov 22 at 9:23












            you can just cast that value to int like, (int) price
            – Chandrani Chatterjee
            Nov 22 at 12:08




            you can just cast that value to int like, (int) price
            – Chandrani Chatterjee
            Nov 22 at 12:08










            up vote
            -1
            down vote













            make pojo class like this way..



            public class DataItem{

            @SerializedName("dataid")
            private String dataid;

            @SerializedName("dataname")
            private String dataname;

            public void setDataid(String dataid){
            this.dataid = dataid;
            }

            public String getDataid(){
            return dataid;
            }

            public void setDataname(String dataname){
            this.dataname = dataname;
            }

            public String getDataname(){
            return dataname;
            }

            @Override
            public String toString(){
            return
            "DataItem{" +
            "dataid = '" + dataid + ''' +
            ",dataname = '" + dataname + ''' +
            "}";
            }
            }


            public class Edit{

            @SerializedName("user_id")
            private String userId;

            @SerializedName("id")
            private String id;

            public void setUserId(String userId){
            this.userId = userId;
            }

            public String getUserId(){
            return userId;
            }

            public void setId(String id){
            this.id = id;
            }

            public String getId(){
            return id;
            }

            @Override
            public String toString(){
            return
            "Edit{" +
            "user_id = '" + userId + ''' +
            ",id = '" + id + ''' +
            "}";
            }
            }


            public class Response{

            @SerializedName("result")
            private String result;

            @SerializedName("data")
            private List<DataItem> data;

            @SerializedName("edit")
            private Edit edit;

            @SerializedName("responseMessage")
            private String responseMessage;

            public void setResult(String result){
            this.result = result;
            }

            public String getResult(){
            return result;
            }

            public void setData(List<DataItem> data){
            this.data = data;
            }

            public List<DataItem> getData(){
            return data;
            }

            public void setEdit(Edit edit){
            this.edit = edit;
            }

            public Edit getEdit(){
            return edit;
            }

            public void setResponseMessage(String responseMessage){
            this.responseMessage = responseMessage;
            }

            public String getResponseMessage(){
            return responseMessage;
            }

            @Override
            public String toString(){
            return
            "Response{" +
            "result = '" + result + ''' +
            ",data = '" + data + ''' +
            ",edit = '" + edit + ''' +
            ",responseMessage = '" + responseMessage + ''' +
            "}";
            }
            }


            Generate pojo class used Robopojo plugin.






            share|improve this answer





















            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09















            up vote
            -1
            down vote













            make pojo class like this way..



            public class DataItem{

            @SerializedName("dataid")
            private String dataid;

            @SerializedName("dataname")
            private String dataname;

            public void setDataid(String dataid){
            this.dataid = dataid;
            }

            public String getDataid(){
            return dataid;
            }

            public void setDataname(String dataname){
            this.dataname = dataname;
            }

            public String getDataname(){
            return dataname;
            }

            @Override
            public String toString(){
            return
            "DataItem{" +
            "dataid = '" + dataid + ''' +
            ",dataname = '" + dataname + ''' +
            "}";
            }
            }


            public class Edit{

            @SerializedName("user_id")
            private String userId;

            @SerializedName("id")
            private String id;

            public void setUserId(String userId){
            this.userId = userId;
            }

            public String getUserId(){
            return userId;
            }

            public void setId(String id){
            this.id = id;
            }

            public String getId(){
            return id;
            }

            @Override
            public String toString(){
            return
            "Edit{" +
            "user_id = '" + userId + ''' +
            ",id = '" + id + ''' +
            "}";
            }
            }


            public class Response{

            @SerializedName("result")
            private String result;

            @SerializedName("data")
            private List<DataItem> data;

            @SerializedName("edit")
            private Edit edit;

            @SerializedName("responseMessage")
            private String responseMessage;

            public void setResult(String result){
            this.result = result;
            }

            public String getResult(){
            return result;
            }

            public void setData(List<DataItem> data){
            this.data = data;
            }

            public List<DataItem> getData(){
            return data;
            }

            public void setEdit(Edit edit){
            this.edit = edit;
            }

            public Edit getEdit(){
            return edit;
            }

            public void setResponseMessage(String responseMessage){
            this.responseMessage = responseMessage;
            }

            public String getResponseMessage(){
            return responseMessage;
            }

            @Override
            public String toString(){
            return
            "Response{" +
            "result = '" + result + ''' +
            ",data = '" + data + ''' +
            ",edit = '" + edit + ''' +
            ",responseMessage = '" + responseMessage + ''' +
            "}";
            }
            }


            Generate pojo class used Robopojo plugin.






            share|improve this answer





















            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09













            up vote
            -1
            down vote










            up vote
            -1
            down vote









            make pojo class like this way..



            public class DataItem{

            @SerializedName("dataid")
            private String dataid;

            @SerializedName("dataname")
            private String dataname;

            public void setDataid(String dataid){
            this.dataid = dataid;
            }

            public String getDataid(){
            return dataid;
            }

            public void setDataname(String dataname){
            this.dataname = dataname;
            }

            public String getDataname(){
            return dataname;
            }

            @Override
            public String toString(){
            return
            "DataItem{" +
            "dataid = '" + dataid + ''' +
            ",dataname = '" + dataname + ''' +
            "}";
            }
            }


            public class Edit{

            @SerializedName("user_id")
            private String userId;

            @SerializedName("id")
            private String id;

            public void setUserId(String userId){
            this.userId = userId;
            }

            public String getUserId(){
            return userId;
            }

            public void setId(String id){
            this.id = id;
            }

            public String getId(){
            return id;
            }

            @Override
            public String toString(){
            return
            "Edit{" +
            "user_id = '" + userId + ''' +
            ",id = '" + id + ''' +
            "}";
            }
            }


            public class Response{

            @SerializedName("result")
            private String result;

            @SerializedName("data")
            private List<DataItem> data;

            @SerializedName("edit")
            private Edit edit;

            @SerializedName("responseMessage")
            private String responseMessage;

            public void setResult(String result){
            this.result = result;
            }

            public String getResult(){
            return result;
            }

            public void setData(List<DataItem> data){
            this.data = data;
            }

            public List<DataItem> getData(){
            return data;
            }

            public void setEdit(Edit edit){
            this.edit = edit;
            }

            public Edit getEdit(){
            return edit;
            }

            public void setResponseMessage(String responseMessage){
            this.responseMessage = responseMessage;
            }

            public String getResponseMessage(){
            return responseMessage;
            }

            @Override
            public String toString(){
            return
            "Response{" +
            "result = '" + result + ''' +
            ",data = '" + data + ''' +
            ",edit = '" + edit + ''' +
            ",responseMessage = '" + responseMessage + ''' +
            "}";
            }
            }


            Generate pojo class used Robopojo plugin.






            share|improve this answer












            make pojo class like this way..



            public class DataItem{

            @SerializedName("dataid")
            private String dataid;

            @SerializedName("dataname")
            private String dataname;

            public void setDataid(String dataid){
            this.dataid = dataid;
            }

            public String getDataid(){
            return dataid;
            }

            public void setDataname(String dataname){
            this.dataname = dataname;
            }

            public String getDataname(){
            return dataname;
            }

            @Override
            public String toString(){
            return
            "DataItem{" +
            "dataid = '" + dataid + ''' +
            ",dataname = '" + dataname + ''' +
            "}";
            }
            }


            public class Edit{

            @SerializedName("user_id")
            private String userId;

            @SerializedName("id")
            private String id;

            public void setUserId(String userId){
            this.userId = userId;
            }

            public String getUserId(){
            return userId;
            }

            public void setId(String id){
            this.id = id;
            }

            public String getId(){
            return id;
            }

            @Override
            public String toString(){
            return
            "Edit{" +
            "user_id = '" + userId + ''' +
            ",id = '" + id + ''' +
            "}";
            }
            }


            public class Response{

            @SerializedName("result")
            private String result;

            @SerializedName("data")
            private List<DataItem> data;

            @SerializedName("edit")
            private Edit edit;

            @SerializedName("responseMessage")
            private String responseMessage;

            public void setResult(String result){
            this.result = result;
            }

            public String getResult(){
            return result;
            }

            public void setData(List<DataItem> data){
            this.data = data;
            }

            public List<DataItem> getData(){
            return data;
            }

            public void setEdit(Edit edit){
            this.edit = edit;
            }

            public Edit getEdit(){
            return edit;
            }

            public void setResponseMessage(String responseMessage){
            this.responseMessage = responseMessage;
            }

            public String getResponseMessage(){
            return responseMessage;
            }

            @Override
            public String toString(){
            return
            "Response{" +
            "result = '" + result + ''' +
            ",data = '" + data + ''' +
            ",edit = '" + edit + ''' +
            ",responseMessage = '" + responseMessage + ''' +
            "}";
            }
            }


            Generate pojo class used Robopojo plugin.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 22 at 5:37









            Android Team

            7,45811033




            7,45811033












            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09


















            • It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
              – Vladyslav Matviienko
              Nov 22 at 6:09
















            It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
            – Vladyslav Matviienko
            Nov 22 at 6:09




            It is generally bad to do other people's work instead of them. It makes people even more lazy. Please don't.
            – Vladyslav Matviienko
            Nov 22 at 6:09


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424414%2fi-am-not-able-to-access-data-as-per-pojo-class%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Berounka

            Fiat S.p.A.

            Type 'String' is not a subtype of type 'int' of 'index'