Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. public class CitiesResponse
  2. {
  3. @SerializedName("collection")
  4. @Expose
  5. //@Valid
  6. private List<City> cities = new ArrayList<City>();
  7. @Expose
  8. private Integer count;
  9. @Expose
  10. private String type;
  11.  
  12. /**
  13. *
  14. * @return The collection
  15. */
  16. public List<City> getCities()
  17. {
  18. return cities;
  19. }
  20. ...
  21. }
  22.  
  23.  
  24. public class City
  25. {
  26.  
  27. @Expose
  28. private Integer id;
  29. @Expose
  30. private Double lat;
  31. @Expose
  32. private Double lng;
  33. @Expose
  34. private String name;
  35. @SerializedName("short_name")
  36. @Expose
  37. private String shortName;
  38. @Expose
  39. private String state;
  40. @Expose
  41. private String timezone;
  42. @Expose
  43. private String type;
  44.  
  45. /**
  46. *
  47. * @return The id
  48. */
  49. public Integer getId()
  50. {
  51. return id;
  52. }
  53.  
  54. /**
  55. *
  56. * @param id
  57. * The id
  58. */
  59. public void setId(Integer id)
  60. {
  61. this.id = id;
  62. }
  63.  
  64. public City withId(Integer id)
  65. {
  66. this.id = id;
  67. return this;
  68. }
  69.  
  70. /**
  71. *
  72. * @return The lat
  73. */
  74. public Double getLat()
  75. {
  76. return lat;
  77. }
  78.  
  79. /**
  80. *
  81. * @param lat
  82. * The lat
  83. */
  84. public void setLat(Double lat)
  85. {
  86. this.lat = lat;
  87. }
  88.  
  89. public City withLat(Double lat)
  90. {
  91. this.lat = lat;
  92. return this;
  93. }
  94.  
  95. /**
  96. *
  97. * @return The lng
  98. */
  99. public Double getLng()
  100. {
  101. return lng;
  102. }
  103.  
  104. /**
  105. *
  106. * @param lng
  107. * The lng
  108. */
  109. public void setLng(Double lng)
  110. {
  111. this.lng = lng;
  112. }
  113.  
  114. public City withLng(Double lng)
  115. {
  116. this.lng = lng;
  117. return this;
  118. }
  119.  
  120. /**
  121. *
  122. * @return The name
  123. */
  124. public String getName()
  125. {
  126. return name;
  127. }
  128.  
  129. /**
  130. *
  131. * @param name
  132. * The name
  133. */
  134. public void setName(String name)
  135. {
  136. this.name = name;
  137. }
  138.  
  139. public City withName(String name)
  140. {
  141. this.name = name;
  142. return this;
  143. }
  144.  
  145. /**
  146. *
  147. * @return The shortName
  148. */
  149. public String getShortName()
  150. {
  151. return shortName;
  152. }
  153.  
  154. /**
  155. *
  156. * @param shortName
  157. * The short_name
  158. */
  159. public void setShortName(String shortName)
  160. {
  161. this.shortName = shortName;
  162. }
  163.  
  164. public City withShortName(String shortName)
  165. {
  166. this.shortName = shortName;
  167. return this;
  168. }
  169.  
  170. /**
  171. *
  172. * @return The state
  173. */
  174. public String getState()
  175. {
  176. return state;
  177. }
  178.  
  179. /**
  180. *
  181. * @param state
  182. * The state
  183. */
  184. public void setState(String state)
  185. {
  186. this.state = state;
  187. }
  188.  
  189. public City withState(String state)
  190. {
  191. this.state = state;
  192. return this;
  193. }
  194.  
  195. /**
  196. *
  197. * @return The timezone
  198. */
  199. public String getTimezone()
  200. {
  201. return timezone;
  202. }
  203.  
  204. /**
  205. *
  206. * @param timezone
  207. * The timezone
  208. */
  209. public void setTimezone(String timezone)
  210. {
  211. this.timezone = timezone;
  212. }
  213.  
  214. public City withTimezone(String timezone)
  215. {
  216. this.timezone = timezone;
  217. return this;
  218. }
  219.  
  220. /**
  221. *
  222. * @return The type
  223. */
  224. public String getType()
  225. {
  226. return type;
  227. }
  228.  
  229. /**
  230. *
  231. * @param type
  232. * The type
  233. */
  234. public void setType(String type)
  235. {
  236. this.type = type;
  237. }
  238.  
  239. public City withType(String type)
  240. {
  241. this.type = type;
  242. return this;
  243. }
  244.  
  245. @Override
  246. public String toString()
  247. {
  248. return ToStringBuilder.reflectionToString(this);
  249. }
  250.  
  251. @Override
  252. public int hashCode()
  253. {
  254. return new HashCodeBuilder().append(id).append(lat).append(lng)
  255. .append(name).append(shortName).append(state).append(timezone)
  256. .append(type).toHashCode();
  257. }
  258.  
  259. @Override
  260. public boolean equals(Object other)
  261. {
  262. if (other == this)
  263. {
  264. return true;
  265. }
  266. if ((other instanceof City) == false)
  267. {
  268. return false;
  269. }
  270. City rhs = ((City) other);
  271. return new EqualsBuilder().append(id, rhs.id).append(lat, rhs.lat)
  272. .append(lng, rhs.lng).append(name, rhs.name)
  273. .append(shortName, rhs.shortName).append(state, rhs.state)
  274. .append(timezone, rhs.timezone).append(type, rhs.type)
  275. .isEquals();
  276. }
  277. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement