@Test public void testCustomConverter() { final Calendar day = Calendar.getInstance(); day.set(Calendar.YEAR, day.get(Calendar.YEAR) - 1); day.set(Calendar.MONTH, day.get(Calendar.MONTH) - 1); MustacheEngine engine = MustacheEngineBuilder.newBuilder() .omitServiceLoaderConfigurationExtensions() .setLocaleSupport(FixedLocaleSupport.from(Locale.ENGLISH)) .addResolver(new ThisResolver()) .registerHelper("pretty", PrettyTimeHelper.builder() .setConverter(from -> day.getTime()).build()) .build(); assertEquals("1 year ago", engine.compileMustache("pretty_conv", "{{pretty this}}") .render(Calendar.getInstance())); }
public static Builder builder() { return new Builder(); }
PrettyTimeHelper extends LocaleAwareValueHelper { public static Builder builder() { return new Builder(); } }
PrettyTimeHelper extends LocaleAwareValueHelper { public static Builder builder() { return new Builder(); } PrettyTimeHelper();  PrettyTimeHelper(PrettyTimeFactory prettyTimeFactory);  PrettyTimeHelper(PrettyTimeFactory factory,
            Converter<Object, Date> converter); }
PrettyTimeHelper extends LocaleAwareValueHelper { public static Builder builder() { return new Builder(); } PrettyTimeHelper();  PrettyTimeHelper(PrettyTimeFactory prettyTimeFactory);  PrettyTimeHelper(PrettyTimeFactory factory,
            Converter<Object, Date> converter); @Override void init(Configuration configuration); @Override void execute(Options options); static Builder builder(); }
PrettyTimeHelper extends LocaleAwareValueHelper { public static Builder builder() { return new Builder(); } PrettyTimeHelper();  PrettyTimeHelper(PrettyTimeFactory prettyTimeFactory);  PrettyTimeHelper(PrettyTimeFactory factory,
            Converter<Object, Date> converter); @Override void init(Configuration configuration); @Override void execute(Options options); static Builder builder(); static final String COMPUTING_CACHE_CONSUMER_ID; static final String DEFAULT_NAME; }