org.kie.api.fluent

## Class Variable<T>

- java.lang.Object
- - org.kie.api.fluent.Variable<T>

- Type Parameters:
    `T` - data type of the variable

      public class Variable<T>
      extends Object

  Builder pattern like class used to build a variable.
  A variable requires a name and a data type.
  Value and metadata are optional.
  Usage:

        Variable.var("test",String.class)
                .value("example value")
                .metadata("readOnly",true).
                .metadata("required",false)

  See Also:
    `NodeContainerBuilder.variable(Variable)`

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,Object>` | `getMetadata()`
    `String` | `getName()`
    `Class<T>` | `getType()`
    `T` | `getValue()`
    `Variable<T>` | `metadata(String key, Object value)`
    `String` | `toString()`
    `Variable<T>` | `value(T value)`
    `static <T> Variable<T>` | `var(String name, Class<T> type)`

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

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

- - ### Method Detail

    - #### var

          public static <T> Variable<T> var(String name,
                                            Class<T> type)

    - #### value

          public Variable<T> value(T value)

    - #### metadata

          public Variable<T> metadata(String key,
                                      Object value)

    - #### getName

          public String getName()

    - #### getValue

          public T getValue()

    - #### getType

          public Class<T> getType()

    - #### getMetadata

          public Map<String,Object> getMetadata()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.