Package io.karatelabs.js
Class JsUndefined
java.lang.Object
io.karatelabs.js.JsUndefined
- All Implemented Interfaces:
JsValue
Singleton representing JavaScript's undefined value.
Implements JsValue so it's handled uniformly with other JS types.
getJavaValue() returns null for Java interop.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the idiomatic Java representation of this object.Returns the raw internal value for use in JS operations (comparison, arithmetic, etc.).toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.karatelabs.js.JsValue
getOriginalJavaValue
-
Field Details
-
INSTANCE
-
-
Method Details
-
getJavaValue
Description copied from interface:JsValueReturns the idiomatic Java representation of this object. Used when values leave the JS engine and need to be consumed by Java code.Examples: JsNumber → Number, JsDate → Date, JsUint8Array → byte[]
- Specified by:
getJavaValuein interfaceJsValue
-
getJsValue
Description copied from interface:JsValueReturns the raw internal value for use in JS operations (comparison, arithmetic, etc.). This enables a consistent "unwrap first, then switch on raw types" pattern.Examples: JsNumber → Number, JsDate → Long (millis), JsUint8Array → byte[]
Default implementation delegates to
JsValue.getJavaValue()which is correct for most types. Override when internal representation differs from external (e.g., JsDate stores long millis).- Specified by:
getJsValuein interfaceJsValue
-
toString
-