public enum NumberHelper extends Enum<NumberHelper> implements Helper<Object>
| Enum Constant and Description |
|---|
isEven
You can use the isEven helper to return a value only if the first argument
is even.
|
isOdd
You can use the isOdd helper to return a value only if the first argument
is odd.
|
stripes
You can use the stripes helper to return different value if the passed
argument is odd or even.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
apply(Object context,
Options options) |
protected boolean |
isEven(Number value)
Apply the helper to the context.
|
static void |
register(Handlebars handlebars)
Register all the number helpers.
|
void |
registerHelper(Handlebars handlebars)
Register the helper in a handlebars instance.
|
protected abstract CharSequence |
safeApply(Number value,
Options options)
Apply the helper to the context.
|
static NumberHelper |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NumberHelper[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NumberHelper isEven
public static final NumberHelper isOdd
public static final NumberHelper stripes
public static NumberHelper[] values()
for (NumberHelper c : NumberHelper.values()) System.out.println(c);
public static NumberHelper valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Object apply(Object context, Options options) throws IOException
apply in interface Helper<Object>IOExceptionprotected abstract CharSequence safeApply(Number value, Options options)
value - The context object (param=0).options - The options object.protected boolean isEven(Number value)
value - The number value.public void registerHelper(Handlebars handlebars)
handlebars - A handlebars object. Required.public static void register(Handlebars handlebars)
handlebars - The helper's owner. Required.Copyright © 2018. All rights reserved.