public class JSBoolean extends JSPrimitive<java.lang.Boolean>
Modifier and Type | Method and Description |
---|---|
JSBoolean |
asBoolean()
Casts the current JavaScript object to
将当前的JavaScript对象转换为JSBoolean类型。 JSBoolean type.
|
boolean |
getBooleanValue()
Returns boolean value of the current JavaScript object if object represents a primitive boolean or Boolean object, otherwise throws
如果object表示原始的boolean或Boolean对象,则返回当前JavaScript对象的boolean值,否则抛出IllegalStateException。 IllegalStateException .
|
java.lang.Boolean |
getValue()
Returns the value of the current primitive instance.
返回当前原始实例的值。 |
boolean |
isBoolean()
Indicates whether JavaScript value is a boolean value.
指示JavaScript值是否为布尔值。 |
toString
asArray, asBooleanObject, asFunction, asJavaObject, asNumber, asNumberObject, asObject, asString, asStringObject, getNumberValue, getStringValue, isArray, isBooleanObject, isFunction, isJavaObject, isNull, isNumber, isNumberObject, isObject, isString, isStringObject, isUndefined
public boolean isBoolean()
JSValue
true
, then the value can be casted to
JSBoolean
type. For example:
if (value.isBoolean()) { JSBoolean bool = value.asBoolean(); }
public boolean getBooleanValue()
JSValue
IllegalStateException
.
getBooleanValue
in class
JSValue
public JSBoolean asBoolean()
JSValue
JSBoolean
type. If the current object doesn't represent a boolean value, the
IllegalStateException
error is thrown.
public java.lang.Boolean getValue()
JSPrimitive
getValue
in class
JSPrimitive<java.lang.Boolean>