Interface ExtensionDataBuilder

    • Method Detail

      • valueBuilder

        ValueBuilder valueBuilder​(java.lang.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:
        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 - Use ValueBuilder 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 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:
        java.lang.IllegalArgumentException - If either parameter is null
      • 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 using Table.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 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.