TemplateBooleanModel (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template, interface: TemplateBooleanModel

Package freemarker.template

# Interface TemplateBooleanModel

All Superinterfaces:
  `TemplateModel`

All Known Implementing Classes:
  `BooleanModel`, `JythonHashModel`, `JythonModel`, `JythonNumberModel`, `JythonSequenceModel`, `RhinoFunctionModel`, `RhinoScriptableModel`

public interface TemplateBooleanModel extends TemplateModel
"boolean" template language data type; same as in Java; either `true` or `false`.

Objects of this type should be immutable, that is, calling `getAsBoolean()` should always return the same value as for the first time.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static TemplateBooleanModel`
  `FALSE`
  A singleton object to represent boolean false
  `static TemplateBooleanModel`
  `TRUE`
  A singleton object to represent boolean true

  ### Fields inherited from interface freemarker.template.TemplateModel

  `NOTHING`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `getAsBoolean()`

- ## Field Details

  - ### FALSE

    static final TemplateBooleanModel FALSE
    A singleton object to represent boolean false

  - ### TRUE

    static final TemplateBooleanModel TRUE
    A singleton object to represent boolean true

- ## Method Details

  - ### getAsBoolean

    boolean getAsBoolean() throws TemplateModelException
    Returns:
      whether to interpret this object as true or false in a boolean context
    Throws:
      `TemplateModelException`