oimtrust

Condition_WeatherYahooApp

Nov 28th, 2016
1,594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package com.oimtrust.weatheryahoo.data;
  2.  
  3. import org.json.JSONObject;
  4.  
  5. /**
  6.  * Created by Oim on 10/12/2016.
  7.  */
  8.  
  9. public class Condition implements JSONPopulator {
  10.     private int code;
  11.     private int temperature;
  12.     private String description;
  13.  
  14.     public int getCode() {
  15.         return code;
  16.     }
  17.  
  18.     public int getTemperature() {
  19.         return temperature;
  20.     }
  21.  
  22.     public String getDescription() {
  23.         return description;
  24.     }
  25.  
  26.     @Override
  27.     public void populate(JSONObject data) {
  28.         code        = data.optInt("code");
  29.         temperature = data.optInt("temp");
  30.         description = data.optString("text");
  31.     }
  32. }
Add Comment
Please, Sign In to add comment