Package org.apache.sling.scripting.sightly.compiler.expression.nodes

## Class BooleanConstant

- java.lang.Object
- - org.apache.sling.scripting.sightly.compiler.expression.nodes.BooleanConstant

All Implemented Interfaces:
  `ExpressionNode`, `Atom`

    public final class BooleanConstant
    extends Object
    implements Atom

Defines a Boolean constant (e.g. "true" or "false").

### Field Summary

Fields
`static BooleanConstant` `FALSE`
`static BooleanConstant` `TRUE`

### Constructor Summary

Constructors
`BooleanConstant​(boolean value)` Creates a boolean constant from a boolean value.
`BooleanConstant​(String text)` Creates a boolean constant from a raw string.

### Method Summary

All Methods Instance Methods Concrete Methods
`<T> T` `accept​(NodeVisitor<T> visitor)` Accept a visitor to process this node.
`String` `getText()` Get the text content for this nodes
`boolean` `getValue()` Returns the boolean value of the constant.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### FALSE

    public static final BooleanConstant FALSE

#### TRUE

    public static final BooleanConstant TRUE

### Constructor Detail

#### BooleanConstant

    public BooleanConstant​(String text)

Creates a boolean constant from a raw string.

Parameters:
  `text` - the raw string

#### BooleanConstant

    public BooleanConstant​(boolean value)

Creates a boolean constant from a boolean value.

Parameters:
  `value` - the value from which this constant is created

### Method Detail

#### getValue

    public boolean getValue()

Returns the boolean value of the constant.

Returns:
  the boolean value of the constant

#### getText

    public String getText()

Description copied from interface: `Atom`
Get the text content for this nodes

Specified by:
  `getText` in interface `Atom`
Returns:
  the text content

#### accept

    public <T> T accept​(NodeVisitor<T> visitor)

Description copied from interface: `ExpressionNode`
Accept a visitor to process this node.

Specified by:
  `accept` in interface `ExpressionNode`
Type Parameters:
  `T` - the type of the visitor
Parameters:
  `visitor` - The visitor
Returns:
  the node after it has been evaluated by the visitor

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`