How to get the json data from server in recycler view in android using retrofit? : Hi i am using Retrofit for parsing data in recycler view i am not knowledgable about Retrofit please help me..

My Json Fromat:

  
     [{"id":3106,"sku":"62974","name":"NESTLE CERELAC STG 1 WHEAT 300G","attribute_set_id":4,"price":164,"status":1,"visibility":4,"type_id":"simple","created_at":"2017-08-16 16:15:30","updated_at":"2017-09-14 06:54:36","extension_attributes":{"stock_item":{"item_id":5627,"product_id":3106,"stock_id":1,"qty":3,"is_in_stock":true,"is_qty_decimal":false,"show_default_notification_message":false,"use_config_min_qty":true,"min_qty":0,"use_config_min_sale_qty":1,"min_sale_qty":1,"use_config_max_sale_qty":true,"max_sale_qty":10000,"use_config_backorders":true,"backorders":0,"use_config_notify_stock_qty":true,"notify_stock_qty":1,"use_config_qty_increments":true,"qty_increments":0,"use_config_enable_qty_inc":true,"enable_qty_increments":false,"use_config_manage_stock":true,"manage_stock":true,"low_stock_date":null,"is_decimal_divided":false,"stock_status_changed_auto":0}},"product_links":[],"options":[],"media_gallery_entries":[{"id":1127,"media_type":"image","label":"","position":1,"disabled":false,"types":["image","small_image","thumbnail","swatch_image"],"file":"\/6\/2\/62974.png"}],"tier_prices":[],"custom_attributes":[{"attribute_code":"description","value":"
    NESTLE CERELAC STG 1 WHEAT 300G<\/p>"},{"attribute_code":"short_description","value":"
    
    NESTLE CERELAC STG 1 WHEAT 300G<\/p>"},{"attribute_code":"special_price","value":"160.7200"},{"attribute_code":"special_from_date","value":"2017-08-17 20:17:57"},{"attribute_code":"meta_title","value":"NESTLE CERELAC STG 1 WHEAT 300G"},{"attribute_code":"meta_description","value":"NESTLE CERELAC STG 1 WHEAT 300G"},{"attribute_code":"image","value":"\/6\/2\/62974.png"},{"attribute_code":"small_image","value":"\/6\/2\/62974.png"},{"attribute_code":"thumbnail","value":"\/6\/2\/62974.png"},{"attribute_code":"news_from_date","value":"2017-08-17 20:17:57"},{"attribute_code":"custom_design_from","value":"2017-08-17 20:17:57"},{"attribute_code":"category_ids","value":["56","631"]},{"attribute_code":"options_container","value":"container2"},{"attribute_code":"required_options","value":"0"},{"attribute_code":"has_options","value":"0"},{"attribute_code":"msrp_display_actual_price_type","value":"0"},{"attribute_code":"url_key","value":"nestle-cerelac-stg-1-wheat-300g"},{"attribute_code":"gift_message_available","value":"2"},{"attribute_code":"tax_class_id","value":"2"},{"attribute_code":"swatch_image","value":"\/6\/2\/62974.png"}]}


i have get the name, sku, id successfully using below code:

MainActivity:

    public class MainActivity extends AppCompatActivity {
        private final String TAG = "MainActivity";
        private RecyclerView recyclerView;
        private LinearLayoutManager layoutManager;
        private RecyclerViewAdapter adapter;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.recycle_retrofit);
            recyclerView = (RecyclerView)findViewById(R.id.recycler_view);
    //        recyclerView.addItemDecoration(new SimpleDividerItemDecoration(this));
            layoutManager = new LinearLayoutManager(MainActivity.this);
            recyclerView.setLayoutManager(layoutManager);
            requestJsonObject();
        }
        private void requestJsonObject(){
            RequestQueue queue = Volley.newRequestQueue(this);
            String url ="https://alagendransupermart.com/mageapi/cat_product.php?cid=83";
            StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                    Log.d(TAG, "Response " + response);
                    GsonBuilder builder = new GsonBuilder();
                    Gson mGson = builder.create();
                    List<ItemObject> posts = new ArrayList<ItemObject>();
                    posts = Arrays.asList(mGson.fromJson(response, ItemObject[].class));
                    adapter = new RecyclerViewAdapter(MainActivity.this, posts);
                    recyclerView.setAdapter(adapter);
                }
            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    Log.d(TAG, "Error " + error.getMessage());
                }
            });
            queue.add(stringRequest);
        }
    }

Adapter:

    public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewHolders> {
        private List<ItemObject> itemList;
        private Context context;
        public RecyclerViewAdapter(Context context, List<ItemObject> itemList) {
            this.itemList = itemList;
            this.context = context;
        }
        @Override
        public RecyclerViewHolders onCreateViewHolder(ViewGroup parent, int viewType) {
            View layoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_retrofit, null);
            RecyclerViewHolders rcv = new RecyclerViewHolders(layoutView);
            return rcv;
        }
        @Override
        public void onBindViewHolder(RecyclerViewHolders holder, int position) {
            holder.songTitle.setText("Product Name: " + itemList.get(position).getSongTitle());
            holder.songYear.setText("ID: " + itemList.get(position).getSongYear());
            holder.songAuthor.setText("SKU: " + itemList.get(position).getSongAuthor());
        }
        @Override
        public int getItemCount() {
            return this.itemList.size();
        }
    }

Getter and setter:


    public class ItemObject {
        @SerializedName("name")
        private String songTitle;
        @SerializedName("id")
        private String songYear;
        @SerializedName("sku")
        private String songAuthor;
        
        
        
        public ItemObject(String songTitle, String songYear, String songAuthor) {
            this.songTitle = songTitle;
            this.songYear = songYear;
            this.songAuthor = songAuthor;
        }
        public String getSongTitle() {
            return songTitle;
        }
        public String getSongYear() {
            return songYear;
        }
        public String getSongAuthor() {
            return songAuthor;
        }
    }

But how can i get the values inside the next array name like parameters
and there are more than 5 attributes with same name but with different values please help me in writing correct code and get the values.. 