Class DataObjectBuilder

java.lang.Object
com.aquima.interactions.communication.data.DataObjectBuilder

public final class DataObjectBuilder extends Object
Builder object for construction Data Objects without type definition.
Since:
9.3
Author:
A.Pragt
  • Constructor Details

    • DataObjectBuilder

      public DataObjectBuilder()
  • Method Details

    • build

      public DataObject build()
      Returns the constructed data object.
      Returns:
      The data object, never null.
    • setValue

      public DataObjectBuilder setValue(String name, DataObject value)
      Sets the value of a member to a data object.
      Parameters:
      name - The name of the member, not null or empty.
      value - The value, not null.
      Returns:
      DataObjectBuilder - used to chain calls
    • setValue

      public DataObjectBuilder setValue(String name, DataObject[] values)
      Sets the value of a member to an array of data objects.

      The array of values provided in the 'values' argument must be non-empty (it must have one or more elements). All the values must be of the same DataValueType.

      Parameters:
      name - The name of the member, not null or empty.
      values - The values, not null or empty (must have at least one element).
      Returns:
      DataObjectBuilder - used to chain calls
    • setValue

      public DataObjectBuilder setValue(String name, ListValue listValue)
      Sets the value of a member to an array of primitive values.

      The values provided in the 'valuesList' are assumed to be of the same datatype. This implementation does not verify this.

      The 'valueList' argument cannot be of type 'Entity'.

      Parameters:
      name - The name of the member, not null or empty.
      listValue - The values, not null or empty (must have at least one element).
      Returns:
      DataObjectBuilder - used to chain calls
    • setValue

      public DataObjectBuilder setValue(String name, IPrimitiveValue[] values)
      Sets the value of a member to an array of primitive values.

      The array of values provided in the 'values' argument must be non-empty (it must have one or more elements). All the values must be of the same datatype.

      Parameters:
      name - The name of the member, not null or empty.
      values - an array of values, not null or empty (must have at least one element).
      Returns:
      DataObjectBuilder - used to chain calls
    • setValue

      public DataObjectBuilder setValue(String name, IPrimitiveValue value)
      Sets the value of a member to a primitive value.
      Parameters:
      name - The name of the member, not null or empty.
      value - The value, not null.
      Returns:
      DataObjectBuilder - used to chain calls