Interface ValueBuilder
-
public interface ValueBuilder
Used for buildingDataValue
s forExtensionDataBuilder.addValue(Class, DataValue)
.Requires Capability DATA_EXTENSION_BUILDER_API
Obtain an instance with
ExtensionDataBuilder.valueBuilder(String)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DataValue<java.lang.Boolean>
buildBoolean(boolean value)
Build a Boolean.DataValue<java.lang.Boolean>
buildBoolean(java.util.function.Supplier<java.lang.Boolean> value)
Lambda version for conditional return or throwingNotReadyException
.DataValue<java.lang.Boolean>
buildBooleanProvidingCondition(boolean value, java.lang.String providedCondition)
Build a Boolean that provides a value forConditional
.DataValue<java.lang.Boolean>
buildBooleanProvidingCondition(java.util.function.Supplier<java.lang.Boolean> value, java.lang.String providedCondition)
Lambda version for conditional return or throwingNotReadyException
.DataValue<java.lang.Double>
buildDouble(double value)
Build a Floating point number.DataValue<java.lang.Double>
buildDouble(java.util.function.Supplier<java.lang.Double> value)
Lambda version for conditional return or throwingNotReadyException
.DataValue<java.lang.String[]>
buildGroup(java.lang.String[] groups)
Build a list of groups.DataValue<java.lang.String[]>
buildGroup(java.util.function.Supplier<java.lang.String[]> groups)
Lambda version for conditional return or throwingNotReadyException
.DataValue<java.lang.Long>
buildNumber(long value)
Build a Number.DataValue<java.lang.Long>
buildNumber(java.util.function.Supplier<java.lang.Long> value)
Lambda version for conditional return or throwingNotReadyException
.DataValue<java.lang.Double>
buildPercentage(double percentage)
Build a Percentage.DataValue<java.lang.Double>
buildPercentage(java.util.function.Supplier<java.lang.Double> percentage)
Lambda version for conditional return or throwingNotReadyException
.DataValue<java.lang.String>
buildString(java.lang.String value)
Build a String.DataValue<java.lang.String>
buildString(java.util.function.Supplier<java.lang.String> value)
Lambda version for conditional return or throwingNotReadyException
.DataValue<Table>
buildTable(Table table, Color tableColor)
Build a table.DataValue<Table>
buildTable(java.util.function.Supplier<Table> table, Color tableColor)
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder
conditional(Conditional conditional)
Implementation detail - for abstracting annotations with the builder API.ValueBuilder
description(java.lang.String description)
Description about the value that is shown on hover.ValueBuilder
format(FormatType formatType)
buildNumber(long)
specific method, format the value withFormatType
default ValueBuilder
formatAsDateWithSeconds()
buildNumber(long)
specific method, format the value as a epoch ms timestamp.default ValueBuilder
formatAsDateWithYear()
buildNumber(long)
specific method, format the value as a epoch ms timestamp.default ValueBuilder
formatAsTimeAmount()
buildNumber(long)
specific method, format the value as milliseconds of time.ValueBuilder
hideFromUsers(BooleanProvider annotation)
Implementation detail - for abstracting annotations with the builder API.ValueBuilder
icon(Icon icon)
Icon displayed next to the value.default ValueBuilder
icon(java.lang.String iconName, Family iconFamily, Color iconColor)
Icon displayed next to the value.ValueBuilder
methodName(ExtensionMethod method)
Implementation detail - for abstracting annotations with the builder API.ValueBuilder
priority(int priority)
Display-priority of the value, highest value is placed top most.ValueBuilder
showAsPlayerPageLink()
buildString(String)
specific method, link the value to a player page.default ValueBuilder
showAsPlayerPageLink(StringProvider annotation)
Implementation detail - for abstracting annotations with the builder API.ValueBuilder
showInPlayerTable()
Show this value in the players table.default ValueBuilder
showInPlayerTable(boolean show)
Implementation detail - for abstracting annotations with the builder API.default ValueBuilder
showOnTab(Tab annotation)
Implementation detail - for abstracting annotations with the builder API.ValueBuilder
showOnTab(java.lang.String tabName)
Show the value on a specific tab.
-
-
-
Method Detail
-
description
ValueBuilder description(java.lang.String description)
Description about the value that is shown on hover.- Parameters:
description
- Describe what the value is about, maximum 150 characters.- Returns:
- This builder.
-
priority
ValueBuilder priority(int priority)
Display-priority of the value, highest value is placed top most.Two values with same priority may appear in a random order.
- Parameters:
priority
- Priority between 0 andInteger.MAX_VALUE
.- Returns:
- This builder.
-
showInPlayerTable
ValueBuilder showInPlayerTable()
Show this value in the players table.- Returns:
- This builder.
-
icon
default ValueBuilder icon(java.lang.String iconName, Family iconFamily, Color iconColor)
Icon displayed next to the value.See https://fontawesome.com/icons (select 'free')) for icons
- Parameters:
iconName
- Name of the iconiconFamily
- Family of the iconiconColor
- Color of the icon- Returns:
- This builder.
-
icon
ValueBuilder icon(Icon icon)
Icon displayed next to the value.See https://fontawesome.com/icons (select 'free')) for icons
- Parameters:
icon
- Icon built using the methods inIcon
.- Returns:
- This builder.
-
showOnTab
ValueBuilder showOnTab(java.lang.String tabName)
Show the value on a specific tab.Remember to define
TabInfo
annotation.- Parameters:
tabName
- Name of the tab.- Returns:
- This builder.
-
formatAsDateWithYear
default ValueBuilder formatAsDateWithYear()
buildNumber(long)
specific method, format the value as a epoch ms timestamp.- Returns:
- This builder.
-
formatAsDateWithSeconds
default ValueBuilder formatAsDateWithSeconds()
buildNumber(long)
specific method, format the value as a epoch ms timestamp.- Returns:
- This builder.
-
formatAsTimeAmount
default ValueBuilder formatAsTimeAmount()
buildNumber(long)
specific method, format the value as milliseconds of time.- Returns:
- This builder.
-
format
ValueBuilder format(FormatType formatType)
buildNumber(long)
specific method, format the value withFormatType
- Returns:
- This builder.
-
showAsPlayerPageLink
ValueBuilder showAsPlayerPageLink()
buildString(String)
specific method, link the value to a player page.- Returns:
- This builder.
-
buildBoolean
DataValue<java.lang.Boolean> buildBoolean(boolean value)
Build a Boolean. Displayed as "Yes/No" on the page.- Parameters:
value
- true/false- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildBooleanProvidingCondition
DataValue<java.lang.Boolean> buildBooleanProvidingCondition(boolean value, java.lang.String providedCondition)
Build a Boolean that provides a value forConditional
. Displayed as "Yes/No" on the page.- Parameters:
value
- true/false- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildString
DataValue<java.lang.String> buildString(java.lang.String value)
Build a String.- Parameters:
value
- any string. Limited to 50 characters.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildNumber
DataValue<java.lang.Long> buildNumber(long value)
Build a Number.- Parameters:
value
- a non-floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildDouble
DataValue<java.lang.Double> buildDouble(double value)
Build a Floating point number.- Parameters:
value
- a floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildPercentage
DataValue<java.lang.Double> buildPercentage(double percentage)
Build a Percentage.- Parameters:
percentage
- value between 0.0 and 1.0- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildGroup
DataValue<java.lang.String[]> buildGroup(java.lang.String[] groups)
Build a list of groups.- Parameters:
groups
- names of groups a player is in.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildTable
DataValue<Table> buildTable(Table table, Color tableColor)
Build a table.- Parameters:
table
- Table built usingTable.builder()
tableColor
- Color of the table- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildBoolean
DataValue<java.lang.Boolean> buildBoolean(java.util.function.Supplier<java.lang.Boolean> value)
Lambda version for conditional return or throwingNotReadyException
.
-
buildBooleanProvidingCondition
DataValue<java.lang.Boolean> buildBooleanProvidingCondition(java.util.function.Supplier<java.lang.Boolean> value, java.lang.String providedCondition)
Lambda version for conditional return or throwingNotReadyException
.buildBooleanProvidingCondition(boolean, String)
-
buildString
DataValue<java.lang.String> buildString(java.util.function.Supplier<java.lang.String> value)
Lambda version for conditional return or throwingNotReadyException
.buildString(String)
-
buildNumber
DataValue<java.lang.Long> buildNumber(java.util.function.Supplier<java.lang.Long> value)
Lambda version for conditional return or throwingNotReadyException
.buildNumber(long)
-
buildDouble
DataValue<java.lang.Double> buildDouble(java.util.function.Supplier<java.lang.Double> value)
Lambda version for conditional return or throwingNotReadyException
.buildDouble(double)
-
buildPercentage
DataValue<java.lang.Double> buildPercentage(java.util.function.Supplier<java.lang.Double> percentage)
Lambda version for conditional return or throwingNotReadyException
.buildPercentage(double)
-
buildGroup
DataValue<java.lang.String[]> buildGroup(java.util.function.Supplier<java.lang.String[]> groups)
Lambda version for conditional return or throwingNotReadyException
.buildGroup(String[])
-
buildTable
DataValue<Table> buildTable(java.util.function.Supplier<Table> table, Color tableColor)
Lambda version for conditional return or throwingNotReadyException
.buildTable(Table, Color)
-
hideFromUsers
ValueBuilder hideFromUsers(BooleanProvider annotation)
Implementation detail - for abstracting annotations with the builder API.- Parameters:
annotation
- BooleanProvider annotation.- Returns:
- This builder.
-
conditional
ValueBuilder conditional(Conditional conditional)
Implementation detail - for abstracting annotations with the builder API.- Parameters:
conditional
- Conditional annotation.- Returns:
- This builder.
-
showAsPlayerPageLink
default ValueBuilder showAsPlayerPageLink(StringProvider annotation)
Implementation detail - for abstracting annotations with the builder API.- Parameters:
annotation
- StringProvider annotation.- Returns:
- This builder.
-
methodName
ValueBuilder methodName(ExtensionMethod method)
Implementation detail - for abstracting annotations with the builder API.- Parameters:
method
- Method this value is from.- Returns:
- This builder.
-
showInPlayerTable
default ValueBuilder showInPlayerTable(boolean show)
Implementation detail - for abstracting annotations with the builder API.- Parameters:
show
- true/false- Returns:
- This builder.
-
showOnTab
default ValueBuilder showOnTab(Tab annotation)
Implementation detail - for abstracting annotations with the builder API.- Parameters:
annotation
- Tab annotation.- Returns:
- This builder.
-
-