Mercurial Hosting > luan
comparison core/src/luan/Luan.java @ 440:93e6e67768d7
remove Luan.asString()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 04 May 2015 11:34:38 -0600 |
parents | f28320fd671d |
children | bf5e62a9090c |
comparison
equal
deleted
inserted
replaced
439:057c10f55f72 | 440:93e6e67768d7 |
---|---|
47 return "userdata"; | 47 return "userdata"; |
48 } | 48 } |
49 | 49 |
50 public static boolean toBoolean(Object obj) { | 50 public static boolean toBoolean(Object obj) { |
51 return obj != null && !Boolean.FALSE.equals(obj); | 51 return obj != null && !Boolean.FALSE.equals(obj); |
52 } | |
53 | |
54 public static String asString(Object obj) { | |
55 if( obj instanceof String ) | |
56 return (String)obj; | |
57 if( obj instanceof Number ) | |
58 return toString((Number)obj); | |
59 return null; | |
60 } | 52 } |
61 | 53 |
62 public static Number toNumber(Object obj) { | 54 public static Number toNumber(Object obj) { |
63 return toNumber(obj,null); | 55 return toNumber(obj,null); |
64 } | 56 } |