001    /*
002     * Apache License
003     * Version 2.0, January 2004
004     * http://www.apache.org/licenses/
005     *
006     * Copyright 2008 by chenillekit.org
007     *
008     * Licensed under the Apache License, Version 2.0 (the "License");
009     * you may not use this file except in compliance with the License.
010     * You may obtain a copy of the License at
011     *
012     * http://www.apache.org/licenses/LICENSE-2.0
013     *
014     */
015    
016    package org.chenillekit.google.utils.geocode;
017    
018    import org.chenillekit.google.utils.JSONException;
019    import org.chenillekit.google.utils.JSONObject;
020    
021    /**
022     * @version $Id: Status.java 351 2008-11-25 12:40:18Z homburgs $
023     */
024    public class Status
025    {
026        private int code;
027        private String request;
028    
029        public Status(JSONObject json)
030        {
031            buildFromJSON(json);
032        }
033    
034        private void buildFromJSON(JSONObject json)
035        {
036            try
037            {
038                code = json.getInt("code");
039                request = json.getString("request");
040            }
041            catch (JSONException e)
042            {
043                throw new RuntimeException(e);
044            }
045        }
046    
047        public int getCode()
048        {
049            return code;
050        }
051    
052        public String getRequest()
053        {
054            return request;
055        }
056    
057    }