Class IsBlankUtilFunction
java.lang.Object
io.higson.runtime.builtin.implementation.UtilFunction
io.higson.runtime.builtin.implementation.IsBlankUtilFunction
- All Implemented Interfaces:
ContextualUtilFunction
This class represents a utility function for checking a value from the Higson context is blank.
This class provides a call method that takes in a HigsonContext and an array of arguments.
-
Field Summary
FieldsFields inherited from class io.higson.runtime.builtin.implementation.UtilFunction
converter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(HigsonContext ctx, Object[] args) This method checks if a value from the Higson context is blank.Methods inherited from class io.higson.runtime.builtin.implementation.UtilFunction
createHigsonRuntimeException, createHigsonRuntimeException, isValid, toTemporalAmountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.higson.runtime.builtin.implementation.ContextualUtilFunction
getContextPath
-
Field Details
-
CODE
- See Also:
-
INSTANCE
-
-
Constructor Details
-
IsBlankUtilFunction
public IsBlankUtilFunction()
-
-
Method Details
-
call
This method checks if a value from the Higson context is blank.
This method considers an object blank if it meets one of the following conditions:- It is null
- It is the string "undefined" (specific to the Rhino JavaScript engine)
- It is an instance of ParamValue and its isBlank method returns true
- It is an instance of RhinoParamValue and its isBlank method returns true
- It is an instance of MultiValue and its isBlank method returns true
- It is an instance of ValueHolder and its isBlank method returns true
- It is an instance of Collection and it is empty or all its elements are blank
- It is an array and all its elements are blank
- It is an instance of Map and all its values are blank
- It is a CharSequence (like String, StringBuffer, etc.) and is blank according to the StrUtil.isBlank method
- It is an instance of Iterable and it is empty or all its elements are blank
- Specified by:
callin classUtilFunction- Returns:
- true if the object is blank, false otherwise
-