MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / init

Method init

CodenameOne/src/com/codename1/facebook/User.java:243–287  ·  view source on GitHub ↗
(Hashtable toCopy)

Source from the content-addressed store, hash-verified

241 }
242
243 private void init(Hashtable toCopy) {
244 super.copy(toCopy);
245 username = (String) toCopy.get("username");
246 first_name = (String) toCopy.get("first_name");
247 last_name = (String) toCopy.get("last_name");
248 link = (String) toCopy.get("link");
249 about = (String) toCopy.get("about");
250 birthday = (String) toCopy.get("birthday");
251 email = (String) toCopy.get("email");
252 website = (String) toCopy.get("website");
253 bio = (String) toCopy.get("bio");
254 quotes = (String) toCopy.get("quotes");
255 gender = (String) toCopy.get("gender");
256 relationship_status = (String) toCopy.get("relationship_status");
257 Object tz = toCopy.get("timezone");
258 if (tz instanceof Integer) {
259 timezone = ((Integer) tz).longValue();
260 } else if (tz instanceof Long) {
261 timezone = ((Long) tz).longValue();
262 } else if (tz instanceof Short) {
263 timezone = ((Short) tz).shortValue();
264 } else if (tz instanceof Byte) {
265 timezone = ((Byte) tz).byteValue();
266 } else if (tz instanceof Double) {
267 timezone = (long) ((Double) tz).doubleValue();
268 } else if (tz instanceof Float) {
269 timezone = (long) ((Float) tz).floatValue();
270 } else if (tz instanceof String) {
271 try {
272 timezone = Long.parseLong((String) tz);
273 } catch (NumberFormatException ignore) {
274 timezone = 0;
275 }
276 }
277 last_updated = (String) toCopy.get("last_updated");
278 locale = (String) toCopy.get("locale");
279 Hashtable l = (Hashtable) toCopy.get("location");
280 if (l != null) {
281 location = new FBObject(l);
282 }
283 Hashtable h = (Hashtable) toCopy.get("hometown");
284 if (h != null) {
285 hometown = new FBObject(h);
286 }
287 }
288
289 /// {@inheritDoc}
290 @Override

Callers 2

UserMethod · 0.95
copyMethod · 0.95

Calls 8

parseLongMethod · 0.95
copyMethod · 0.65
getMethod · 0.65
longValueMethod · 0.65
doubleValueMethod · 0.65
shortValueMethod · 0.45
byteValueMethod · 0.45
floatValueMethod · 0.45

Tested by

no test coverage detected