Package com.vaadin.flow.internal
Class JavaScriptSemantics
- java.lang.Object
-
- com.vaadin.flow.internal.JavaScriptSemantics
-
public class JavaScriptSemantics extends Object
Helpers for replicating JavaScript semantics in Java.For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isTrueish(Object value)
Gets the boolean value of the provided value:null
isfalse
.
-
-
-
Method Detail
-
isTrueish
public static boolean isTrueish(Object value)
Gets the boolean value of the provided value:null
isfalse
.- String values are
true
, except for the empty string. - Numerical values are
true
, except for 0 andNaN
. - JSON object and JSON array values are always
true
.
- Parameters:
value
- the value to check for truthness- Returns:
true
if the provided value is trueish according to JavaScript semantics, otherwisefalse
-
-