Class ConditionHelper<T>

java.lang.Object
io.polyapi.plugin.service.template.ConditionHelper<T>
Type Parameters:
T - The type of the Helper.
All Implemented Interfaces:
com.github.jknack.handlebars.Helper<T>

public class ConditionHelper<T> extends Object implements com.github.jknack.handlebars.Helper<T>
Helper class that takes a BiPredicate and evaluates the parameters of the Helper.apply(Object, Options) method in it. If true, the function result will be Options.fn(), otherwise Options.inverse()
See Also:
  • Helper
  • Constructor Details

    • ConditionHelper

      public ConditionHelper(BiPredicate<T,com.github.jknack.handlebars.Options> predicate)
  • Method Details

    • apply

      public Object apply(T value, com.github.jknack.handlebars.Options options) throws IOException
      Specified by:
      apply in interface com.github.jknack.handlebars.Helper<T>
      Throws:
      IOException