Unwrap primitive values and map voids to nulls. Non Primitive types remain unchanged. @param obj object type which may be bsh.Primitive @return corresponding "normal" Java type, "unwrapping" any bsh.Primitive types to their wrapper types.
( Object obj )
| 851 | any bsh.Primitive types to their wrapper types. |
| 852 | */ |
| 853 | public static Object unwrap( Object obj ) |
| 854 | { |
| 855 | // map voids to nulls for the outside world |
| 856 | if (obj == Primitive.VOID) |
| 857 | return null; |
| 858 | |
| 859 | // unwrap primitives |
| 860 | if (obj instanceof Primitive) |
| 861 | return((Primitive)obj).getValue(); |
| 862 | else |
| 863 | return obj; |
| 864 | } |
| 865 | |
| 866 | /* |
| 867 | Unwrap Primitive wrappers to their java.lang wrapper values. |
no test coverage detected