Enum ConditionalHelpers
- All Implemented Interfaces:
Helper<Object>,Serializable,Comparable<ConditionalHelpers>,java.lang.constant.Constable
Implementation of equals, greater, lessThan, and, or, etc.. operators.
- Since:
- 4.0.7
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAnd operator.Test if two elements are equals.Greater operator (arguments must beComparableelements.Greater or equal operator (arguments must beComparableelements.Less than operator (arguments must beComparableelements.Less or equal operator (arguments must beComparableelements.Test if two elements are NOT equals.Not operator.Or operator. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConditionalHelpersReturns the enum constant of this type with the specified name.static ConditionalHelpers[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
eq
Test if two elements are equals. Usage: Render 'yes' or 'no':{{#eq a b}} yes {{else}} no {{/eq}}Render 'true' or 'false':{{eq a b}}Render 'y' or 'n':{{eq a b yes='y' no='n'}} -
neq
Test if two elements are NOT equals. Usage: Render 'yes' or 'no':{{#neq a b}} yes {{else}} no {{/neq}}Render 'true' or 'false':{{neq a b}}Render 'y' or 'n':{{neq a b yes='y' no='n'}} -
gt
Greater operator (arguments must beComparableelements. Usage: Render 'yes' or 'no':{{#gt a b}} yes {{else}} no {{/gt}}Render 'true' or 'false':{{gt a b}}Render 'y' or 'n':{{neq a b yes='y' no='n'}} -
gte
Greater or equal operator (arguments must beComparableelements. Usage: Render 'yes' or 'no':{{#gte a b}} yes {{else}} no {{/gte}}Render 'true' or 'false':{{gte a b}}Render 'y' or 'n':{{gte a b yes='y' no='n'}} -
lt
Less than operator (arguments must beComparableelements. Usage: Render 'yes' or 'no':{{#lt a b}} yes {{else}} no {{/lt}}Render 'true' or 'false':{{lt a b}}Render 'y' or 'n':{{lt a b yes='y' no='n'}} -
lte
Less or equal operator (arguments must beComparableelements. Usage: Render 'yes' or 'no':{{#lte a b}} yes {{else}} no {{/lte}}Render 'true' or 'false':{{lte a b}}Render 'y' or 'n':{{lte a b yes='y' no='n'}} -
and
And operator. Truthiness of arguments is determined byHandlebars.Utils.isEmpty(Object), so this helper can be used with non-boolean values. Usage: Render 'yes' or 'no':{{#and a b}} yes {{else}} no {{/and}}Multiple arguments are supported too:{{#and a b c d}} yes {{else}} no {{/and}}Render 'true' or 'false':{{and a b}}Render 'y' or 'n':{{and a b yes='y' no='n'}} -
or
Or operator. Truthiness of arguments is determined byHandlebars.Utils.isEmpty(Object), so this helper can be used with non-boolean values. Usage: Render 'yes' or 'no':{{#or a b}} yes {{else}} no {{/or}}Multiple arguments are supported too:{{#or a b c d}} yes {{else}} no {{/or}}Render 'true' or 'false':{{or a b}}Render 'y' or 'n':{{or a b yes='y' no='n'}} -
not
Not operator. Truthiness of arguments is determined byHandlebars.Utils.isEmpty(Object), so this helper can be used with non-boolean values. Usage: Render 'yes' or 'no':{{#not a}} yes {{else}} no {{/not}}Render 'true' or 'false':{{not a}}Render 'y' or 'n':{{not a yes='y' no='n'}}
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-