Class ArrayBuilder

java.lang.Object
com.launchdarkly.sdk.ArrayBuilder

public final class ArrayBuilder
extends java.lang.Object
A builder created by LDValue.buildArray().

Builder methods are not thread-safe.

  • Constructor Summary

    Constructors 
    Constructor Description
    ArrayBuilder()  
  • Method Summary

    Modifier and Type Method Description
    ArrayBuilder add​(boolean value)
    Adds a new element to the builder.
    ArrayBuilder add​(double value)
    Adds a new element to the builder.
    ArrayBuilder add​(float value)
    Adds a new element to the builder.
    ArrayBuilder add​(int value)
    Adds a new element to the builder.
    ArrayBuilder add​(long value)
    Adds a new element to the builder.
    ArrayBuilder add​(LDValue value)
    Adds a new element to the builder.
    ArrayBuilder add​(java.lang.String value)
    Adds a new element to the builder.
    LDValue build()
    Returns an array containing the builder's current elements.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • add

      public ArrayBuilder add​(LDValue value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • add

      public ArrayBuilder add​(boolean value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • add

      public ArrayBuilder add​(int value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • add

      public ArrayBuilder add​(long value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • add

      public ArrayBuilder add​(float value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • add

      public ArrayBuilder add​(double value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • add

      public ArrayBuilder add​(java.lang.String value)
      Adds a new element to the builder.
      Parameters:
      value - the new element
      Returns:
      the same builder
    • build

      public LDValue build()
      Returns an array containing the builder's current elements. Subsequent changes to the builder will not affect this value (it uses copy-on-write logic, so the previous values will only be copied to a new list if you continue to add elements after calling build().
      Returns:
      an LDValue that is an array