org.eclipse.eef.core.api.utils

## Class EvalFactory.Eval<TYPE>

- java.lang.Object
- - org.eclipse.eef.core.api.utils.EvalFactory.Eval<TYPE>

Type Parameters:
  `TYPE` - The type of the result returned by the execution of the expression

Enclosing class:
  EvalFactory

    public static final class EvalFactory.Eval<TYPE>
    extends java.lang.Object

This class will be used to evaluate the expression.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `call(java.lang.String expression)` Executes the given expression and process its result using the given consumer.
`void` `call(java.lang.String expression, java.util.function.Consumer<TYPE> consumer)` Executes the given expression and process its result using the given consumer.
`EvalFactory.Eval<TYPE>` `defaultValue(TYPE value)` Indicates the value to use by default if the result of the evaluation of the expression is null.
`TYPE` `evaluate(java.lang.String expression)` Executes the given expression.
`EvalFactory.Eval<TYPE>` `logIfBlank(org.eclipse.emf.ecore.EAttribute attribute)` Indicates that an error should be logged using the given EAttribute if the expression to execute is blank.
`<E> EvalFactory.Eval<E>` `logIfInvalidType(java.lang.Class<E> expectedType)` Indicates that the result should have the same type as the given class.

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

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

### Method Detail

#### logIfBlank

    public EvalFactory.Eval<TYPE> logIfBlank(org.eclipse.emf.ecore.EAttribute attribute)

Indicates that an error should be logged using the given EAttribute if the expression to execute is blank.

Parameters:
  `attribute` - The EAttribute containing the expression to execute
Returns:
  The current `EvalFactory.Eval`

#### logIfInvalidType

    public <E> EvalFactory.Eval<E> logIfInvalidType(java.lang.Class<E> expectedType)

Indicates that the result should have the same type as the given class. It will log an error if the type of the result does not match the given type.

Type Parameters:
  `E` - The expected type of the execution of the expression
Parameters:
  `expectedType` - The expected type
Returns:
  The current `EvalFactory.Eval`

#### defaultValue

    public EvalFactory.Eval<TYPE> defaultValue(TYPE value)

Indicates the value to use by default if the result of the evaluation of the expression is null.

Parameters:
  `value` - The default value
Returns:
  The current `EvalFactory.Eval`

#### call

    public void call(java.lang.String expression)

Executes the given expression and process its result using the given consumer.

Parameters:
  `expression` - The expression

#### call

    public void call(java.lang.String expression,
                     java.util.function.Consumer<TYPE> consumer)

Executes the given expression and process its result using the given consumer.

Parameters:
  `expression` - The expression
  `consumer` - The consumer

#### evaluate

    public TYPE evaluate(java.lang.String expression)

Executes the given expression.

Parameters:
  `expression` - The expression
Returns:
  The result of the expression