Package com.hubspot.jinjava.lib.exptest
Interface ExpTest
- All Superinterfaces:
Importable
- All Known Implementing Classes:
CollectionExpTest
,IsBooleanExpTest
,IsContainingAllExpTest
,IsContainingExpTest
,IsDefinedExpTest
,IsDivisibleByExpTest
,IsEqExpTest
,IsEqualsSymbolExpTest
,IsEqualToExpTest
,IsEvenExpTest
,IsFalseExpTest
,IsFloatExpTest
,IsGeTest
,IsGreaterThanExpTest
,IsGreaterThanOrEqualToSymbolExpTest
,IsGreaterThanSymbolExpTest
,IsGtTest
,IsInExpTest
,IsIntegerExpTest
,IsIterableExpTest
,IsLessThanExpTest
,IsLessThanOrEqualToSymbolExpTest
,IsLessThanSymbolExpTest
,IsLeTest
,IsLowerExpTest
,IsLtTest
,IsMappingExpTest
,IsNeExpTest
,IsNoneExpTest
,IsNotEqualToSymbolExpTest
,IsNumberExpTest
,IsOddExpTest
,IsSameAsExpTest
,IsSequenceExpTest
,IsStringContainingExpTest
,IsStringExpTest
,IsStringStartingWithExpTest
,IsTrueExpTest
,IsTruthyExpTest
,IsUndefinedExpTest
,IsUpperExpTest
,IsWithinExpTest
Beside filters there are also so called "tests" available. Tests can be used to test a variable against a common expression. To test a variable or expression you add is plus the name of the test after the variable. For example to find
out if a variable is defined you can do name is defined which will then return true or false depending on if name is defined.
Tests can accept arguments too. If the test only takes one argument you can leave out the parentheses to group them. For example the following two expressions do the same:
{% if loop.index is divisibleby 3 %} {% if loop.index is divisibleby(3) %}
- Author:
- jstehler
-
Method Summary
Modifier and TypeMethodDescriptionboolean
evaluate
(Object var, JinjavaInterpreter interpreter, Object... args) default boolean
evaluateNegated
(Object var, JinjavaInterpreter interpreter, Object... args) Methods inherited from interface com.hubspot.jinjava.lib.Importable
getName
-
Method Details
-
evaluate
-
evaluateNegated
-