Interface ExtensionDataBuilder


public interface ExtensionDataBuilder
Builder API for Extension data.

Requires Capability DATA_EXTENSION_BUILDER_API

Obtain an instance with DataExtension.newExtensionDataBuilder()

Used with DataBuilderProvider. See documentation on how to use the API.

  • Method Details

    • valueBuilder

      ValueBuilder valueBuilder(String text)
      Creates a new ValueBuilder in order to use addValue methods.

      Using same text for two values can be problematic as the text is used for id in the database.

      If you need to use InvalidateMethod with built values, lowercase 'text' and remove all whitespace. Example valueBuilder("Times Jumped"); @InvalidateMethod("timesjumped")

      Parameters:
      text - Text that should be displayed next to the value.
      Returns:
      a new value builder.
      Throws:
      IllegalArgumentException - If text is null or empty String.
    • addValue

      <T> ExtensionDataBuilder addValue(Class<T> ofType, DataValue<T> dataValue)
      Add a value.
      Type Parameters:
      T - Type of the data.
      Parameters:
      ofType - Class for type of the data, matches what Provider annotations want.
      dataValue - Use ValueBuilder to create one.
      Returns:
      This builder.
      Throws:
      IllegalArgumentException - If either parameter is null
    • addValue

      <T> ExtensionDataBuilder addValue(Class<T> ofType, Supplier<DataValue<T>> dataValue)
      Compared to the other addValue method, this method allows you to use NotReadyException when building your data.
      Type Parameters:
      T - Type of the data.
      Parameters:
      ofType - Class for type of the data, matches what Provider annotations want.
      dataValue - Use ValueBuilder to create one.
      Returns:
      This builder.
      Throws:
      IllegalArgumentException - If either parameter is null
    • invalidateValue

      ExtensionDataBuilder invalidateValue(String text)
      Invalidate a value similar to InvalidateMethod annotation, but with the text given to valueBuilder(String).
      Parameters:
      text - The same text that was given to the value builder.
      Returns:
      This builder.
    • addTable

      default ExtensionDataBuilder addTable(String name, Table table, Color color)
      Add a table.
      Parameters:
      name - Name of the table, used in the database.
      table - Table built using Table.builder()
      color - Color of the table
      Returns:
      This builder.
    • addTable

      default ExtensionDataBuilder addTable(String name, Table table, Color color, String tab)
      Add a table to a specific tab.
      Parameters:
      name - Name of the table, used in the database.
      table - Table built using Table.builder()
      color - Color of the table
      tab - Name of the tab, remember to define TabInfo.
      Returns:
      This builder.
    • addAll

      void addAll(ExtensionDataBuilder builder)
      Adds all values and tables in another builder to this builder.
      Parameters:
      builder - Builder to combine with this one.