org.apache.commons.jexl3.internal

## Class SetBuilder

- java.lang.Object
- - org.apache.commons.jexl3.internal.SetBuilder

- All Implemented Interfaces:
    JexlArithmetic.SetBuilder

      public class SetBuilder
      extends Object
      implements JexlArithmetic.SetBuilder

  Helper class to create set literals.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Set<Object>` | `set` The set being created.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SetBuilder(int size)` Creates a new builder.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Object value)` Adds a literal to the set.
    `Object` | `create()` Creates the actual "set" instance.

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

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

- - ### Field Detail

    - #### set

          protected final Set<Object> set

      The set being created.

  - ### Constructor Detail

    - #### SetBuilder

          public SetBuilder(int size)

      Creates a new builder.
      Parameters:
        `size` - the expected set size

  - ### Method Detail

    - #### add

          public void add(Object value)

      Description copied from interface: `JexlArithmetic.SetBuilder`
      Adds a literal to the set.
      Specified by:
        `add` in interface `JexlArithmetic.SetBuilder`
      Parameters:
        `value` - the item to add

    - #### create

          public Object create()

      Description copied from interface: `JexlArithmetic.SetBuilder`
      Creates the actual "set" instance.
      Specified by:
        `create` in interface `JexlArithmetic.SetBuilder`
      Returns:
        the set

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.