MCPcopy Create free account
hub / github.com/beanshell/beanshell / unwrap

Method unwrap

src/bsh/Primitive.java:853–864  ·  view source on GitHub ↗

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 )

Source from the content-addressed store, hash-verified

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.

Callers 15

primitiveEqualsMethod · 0.95
getConstructorArgsMethod · 0.95
getClassInstanceThisMethod · 0.95
assignMethod · 0.95
evalMethod · 0.95
invokeMethodMethod · 0.95
setIndexMethod · 0.95
constructObjectMethod · 0.95
invokeImplMethod · 0.95
putExternalMapMethod · 0.95
setValueMethod · 0.95
getTypeMethod · 0.95

Calls 1

getValueMethod · 0.45

Tested by

no test coverage detected