Class ExtDataBuilder
- java.lang.Object
-
- com.djrapitops.plan.extension.implementation.builder.ExtDataBuilder
-
- All Implemented Interfaces:
ExtensionDataBuilder
public class ExtDataBuilder extends java.lang.Object implements ExtensionDataBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExtDataBuilder.ClassValuePair
-
Constructor Summary
Constructors Constructor Description ExtDataBuilder(DataExtension extension)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(ExtensionDataBuilder builder)
Adds all values and tables in another builder to this builder.<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.java.lang.String
getExtensionName()
java.util.List<ExtDataBuilder.ClassValuePair>
getValues()
ValueBuilder
valueBuilder(java.lang.String text)
Creates a newValueBuilder
in order to use addValue methods.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.djrapitops.plan.extension.builder.ExtensionDataBuilder
addTable, addTable
-
-
-
-
Constructor Detail
-
ExtDataBuilder
public ExtDataBuilder(DataExtension extension)
-
-
Method Detail
-
valueBuilder
public ValueBuilder valueBuilder(java.lang.String text)
Description copied from interface:ExtensionDataBuilder
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")
- Specified by:
valueBuilder
in interfaceExtensionDataBuilder
- Parameters:
text
- Text that should be displayed next to the value.- Returns:
- a new value builder.
-
addValue
public <T> ExtensionDataBuilder addValue(java.lang.Class<T> ofType, DataValue<T> dataValue)
Description copied from interface:ExtensionDataBuilder
Add a value.- Specified by:
addValue
in interfaceExtensionDataBuilder
- 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.
-
addValue
public <T> ExtensionDataBuilder addValue(java.lang.Class<T> ofType, java.util.function.Supplier<DataValue<T>> dataValue)
Description copied from interface:ExtensionDataBuilder
Compared to the other addValue method, this method allows you to useNotReadyException
when building your data.- Specified by:
addValue
in interfaceExtensionDataBuilder
- 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.
-
getValues
public java.util.List<ExtDataBuilder.ClassValuePair> getValues()
-
getExtensionName
public java.lang.String getExtensionName()
-
addAll
public void addAll(ExtensionDataBuilder builder)
Description copied from interface:ExtensionDataBuilder
Adds all values and tables in another builder to this builder.- Specified by:
addAll
in interfaceExtensionDataBuilder
- Parameters:
builder
- Builder to combine with this one.
-
-