java.lang.Object
io.swagger.codegen.v3.generators.handlebars.lambda.TitlecaseLambda
All Implemented Interfaces:
com.github.jknack.handlebars.Lambda

public class TitlecaseLambda extends Object implements com.github.jknack.handlebars.Lambda
Converts text in a fragment to title case. Register:
 additionalProperties.put("titlecase", new TitlecaseLambda());
 
Use:
 {{#titlecase}}{{classname}}{{/titlecase}}
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new instance of TitlecaseLambda, which will convert all text in a space delimited string to title-case.
    Constructs a new instance of TitlecaseLambda, splitting on the specified delimiter and converting each word to title-case.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(Object o, com.github.jknack.handlebars.Template template)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TitlecaseLambda

      public TitlecaseLambda()
      Constructs a new instance of TitlecaseLambda, which will convert all text in a space delimited string to title-case.
    • TitlecaseLambda

      public TitlecaseLambda(String delimiter)
      Constructs a new instance of TitlecaseLambda, splitting on the specified delimiter and converting each word to title-case.

      NOTE: passing null results in a title-casing the first word only.

      Parameters:
      delimiter - Provided to allow an override for the default space delimiter.
  • Method Details

    • apply

      public Object apply(Object o, com.github.jknack.handlebars.Template template) throws IOException
      Specified by:
      apply in interface com.github.jknack.handlebars.Lambda
      Throws:
      IOException