Interface ExtensionDataBuilder
-
- All Known Implementing Classes:
ExtDataBuilder
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addAll(ExtensionDataBuilder builder)
Adds all values and tables in another builder to this builder.default ExtensionDataBuilder
addTable(java.lang.String name, Table table, Color color)
Add a table.default ExtensionDataBuilder
addTable(java.lang.String name, Table table, Color color, java.lang.String tab)
Add a table to a specific tab.<T> ExtensionDataBuilder
addValue(java.lang.Class<T> ofType, DataValue<T> dataValue)
Add a value.<T> ExtensionDataBuilder
addValue(java.lang.Class<T> ofType, java.util.function.Supplier<DataValue<T>> dataValue)
Compared to the other addValue method, this method allows you to useNotReadyException
when building your data.ExtensionDataBuilder
invalidateValue(java.lang.String text)
Invalidate a value similar toInvalidateMethod
annotation, but with the text given tovalueBuilder(String)
.ValueBuilder
valueBuilder(java.lang.String text)
Creates a newValueBuilder
in order to use addValue methods.
-
-
-
Method Detail
-
valueBuilder
ValueBuilder valueBuilder(java.lang.String text)
Creates a newValueBuilder
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. ExamplevalueBuilder("Times Jumped"); @InvalidateMethod("timesjumped")
- Parameters:
text
- Text that should be displayed next to the value.- Returns:
- a new value builder.
- Throws:
java.lang.IllegalArgumentException
- If text is null or empty String.
-
addValue
<T> ExtensionDataBuilder addValue(java.lang.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
- UseValueBuilder
to create one.- Returns:
- This builder.
- Throws:
java.lang.IllegalArgumentException
- If either parameter is null
-
addValue
<T> ExtensionDataBuilder addValue(java.lang.Class<T> ofType, java.util.function.Supplier<DataValue<T>> dataValue)
Compared to the other addValue method, this method allows you to useNotReadyException
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
- UseValueBuilder
to create one.- Returns:
- This builder.
- Throws:
java.lang.IllegalArgumentException
- If either parameter is null
-
invalidateValue
ExtensionDataBuilder invalidateValue(java.lang.String text)
Invalidate a value similar toInvalidateMethod
annotation, but with the text given tovalueBuilder(String)
.- Parameters:
text
- The same text that was given to the value builder.- Returns:
- This builder.
-
addTable
default ExtensionDataBuilder addTable(java.lang.String name, Table table, Color color)
Add a table.- Parameters:
name
- Name of the table, used in the database.table
- Table built usingTable.builder()
color
- Color of the table- Returns:
- This builder.
-
addTable
default ExtensionDataBuilder addTable(java.lang.String name, Table table, Color color, java.lang.String tab)
Add a table to a specific tab.- Parameters:
name
- Name of the table, used in the database.table
- Table built usingTable.builder()
color
- Color of the tabletab
- Name of the tab, remember to defineTabInfo
.- 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.
-
-