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

## Class UnaryOperation

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

All Implemented Interfaces:
  `ExpressionNode`

    public final class UnaryOperation
    extends Object
    implements ExpressionNode

Defines a unary operation (e.g. `!variableName`).

### Constructor Summary

Constructors
`UnaryOperation​(UnaryOperator operator, ExpressionNode target)` Creates a `UnaryOperation`.

### Method Summary

All Methods Instance Methods Concrete Methods
`<T> T` `accept​(NodeVisitor<T> visitor)` Accept a visitor to process this node.
`UnaryOperator` `getOperator()` Returns the operator applied in this operation.
`ExpressionNode` `getTarget()` Returns the target to which the operation is applied.
`String` `toString()`

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

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

### Constructor Detail

#### UnaryOperation

    public UnaryOperation​(UnaryOperator operator,
                          ExpressionNode target)

Creates a `UnaryOperation`.

Parameters:
  `operator` - the operator
  `target` - the target to which the operator is applied

### Method Detail

#### 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

#### getOperator

    public UnaryOperator getOperator()

Returns the operator applied in this operation.

Returns:
  the operator applied in this operation

#### getTarget

    public ExpressionNode getTarget()

Returns the target to which the operation is applied.

Returns:
  the target to which the operation is applied

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`