/*
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */
package com.montealegreluis.yelpv3;

import org.json.JSONObject;

public class Location {
    private final String address1;
    private final String address2;
    private final String address3;
    private final String city;
    private final String state;
    private final String country;
    private final String zipCode;

    public static Location from(JSONObject location) {
        return new Location(location);
    }

    public String address1() {
        return address1;
    }

    public String address2() {
        return address2;
    }

    public String address3() {
        return address3;
    }

    public String city() {
        return city;
    }

    public String state() {
        return state;
    }

    public String country() {
        return country;
    }

    public String zipCode() {
        return zipCode;
    }

    private Location(JSONObject location) {
        address1 = location.getString("address1");
        address2 = !location.isNull("address2") ? location.getString("address2") : "";
        address3 = !location.isNull("address3") ? location.getString("address3") : "";
        city = location.getString("city");
        state = location.getString("state");
        country = location.getString("country");
        zipCode = location.getString("zip_code");
    }
}

@@ -158,21 +158,100 @@
 son.JSON
-Objec
+Array;%0Aimport org.json.JSONObject;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Lis
 t;%0A%0Apubl
@@ -505,16 +505,122 @@
 zipCode;
+%0A    private final String crossStreets;%0A    private final List%3CString%3E displayAddress = new ArrayList%3C%3E();
 %0A%0A    pu
@@ -1133,24 +1133,176 @@
 ode;%0A    %7D%0A%0A
+    public String crossStreets() %7B%0A        return crossStreets;%0A    %7D%0A%0A    public List%3CString%3E displayAddress() %7B%0A        return displayAddress;%0A    %7D%0A%0A
     private 
@@ -1691,24 +1691,24 @@
 %22country%22);%0A
-
         zipC
@@ -1741,20 +1741,425 @@
 zip_code%22);%0A
+        crossStreets = !location.isNull(%22cross_streets%22) ? location.getString(%22cross_streets%22) : %22%22;%0A        if (!location.isNull(%22display_address%22)) setDisplayAddress(location.getJSONArray(%22display_address%22));%0A    %7D%0A%0A    private void setDisplayAddress(JSONArray displayAddress) %7B%0A        for (int i = 0; i %3C displayAddress.length(); i++)%0A            this.displayAddress.add(displayAddress.getString(i));%0A
     %7D%0A%7D%0A

Add crossStreets and displayAddress to Business