Interface ValueBuilder
- All Known Implementing Classes:
ExtValueBuilder
public interface ValueBuilder
Used for building
DataValues for ExtensionDataBuilder.addValue(Class, DataValue).
Requires Capability DATA_EXTENSION_BUILDER_API
Obtain an instance with ExtensionDataBuilder.valueBuilder(String).
-
Method Summary
Modifier and TypeMethodDescriptionbuildBoolean(boolean value) Build a Boolean.buildBoolean(Supplier<Boolean> value) Lambda version for conditional return or throwingNotReadyException.buildBooleanProvidingCondition(boolean value, String providedCondition) Build a Boolean that provides a value forConditional.buildBooleanProvidingCondition(Supplier<Boolean> value, String providedCondition) Lambda version for conditional return or throwingNotReadyException.buildComponent(Component value) Build aComponent.buildComponent(Supplier<Component> value) Lambda version for conditional return or throwingNotReadyException.buildDouble(Double value) Build a Floating point number.buildDouble(Supplier<Double> value) Lambda version for conditional return or throwingNotReadyException.buildGroup(String[] groups) Build a list of groups.buildGroup(Supplier<String[]> groups) Lambda version for conditional return or throwingNotReadyException.buildNumber(Double value) Build a Number.buildNumber(Integer value) Build a Number.buildNumber(Long value) Build a Number.buildNumber(Supplier<Long> value) Lambda version for conditional return or throwingNotReadyException.buildPercentage(Double percentage) Build a Percentage.buildPercentage(Supplier<Double> percentage) Lambda version for conditional return or throwingNotReadyException.buildString(String value) Build a String.buildString(Supplier<String> value) Lambda version for conditional return or throwingNotReadyException.buildTable(Table table, Color tableColor) Build a table.buildTable(Supplier<Table> table, Color tableColor) Lambda version for conditional return or throwingNotReadyException.conditional(Conditional conditional) Implementation detail - for abstracting annotations with the builder API.description(String description) Description about the value that is shown on hover.format(FormatType formatType) buildNumber(Long)specific method, format the value withFormatTypedefault ValueBuilderbuildNumber(Long)specific method, format the value as a epoch ms timestamp.default ValueBuilderbuildNumber(Long)specific method, format the value as a epoch ms timestamp.default ValueBuilderbuildNumber(Long)specific method, format the value as milliseconds of time.hideFromUsers(BooleanProvider annotation) Implementation detail - for abstracting annotations with the builder API.Icon displayed next to the value.default ValueBuilderIcon displayed next to the value.methodName(ExtensionMethod method) Implementation detail - for abstracting annotations with the builder API.priority(int priority) Display-priority of the value, highest value is placed top most.buildString(String)specific method, link the value to a player page.default ValueBuildershowAsPlayerPageLink(StringProvider annotation) Implementation detail - for abstracting annotations with the builder API.Show this value in the players table.default ValueBuildershowInPlayerTable(boolean show) Implementation detail - for abstracting annotations with the builder API.default ValueBuilderImplementation detail - for abstracting annotations with the builder API.Show the value on a specific tab.
-
Method Details
-
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
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
Icon displayed next to the value.See FontAwesome (select 'free')) for icons
- Parameters:
iconName- Name of the iconiconFamily- Family of the iconiconColor- Color of the icon- Returns:
- This builder.
-
icon
Icon displayed next to the value.See FontAwesome (select 'free')) for icons
- Parameters:
icon- Icon built using the methods inIcon.- Returns:
- This builder.
-
showOnTab
Show the value on a specific tab.Remember to define
TabInfoannotation.- Parameters:
tabName- Name of the tab.- Returns:
- This builder.
-
formatAsDateWithYear
buildNumber(Long)specific method, format the value as a epoch ms timestamp.- Returns:
- This builder.
-
formatAsDateWithSeconds
buildNumber(Long)specific method, format the value as a epoch ms timestamp.- Returns:
- This builder.
-
formatAsTimeAmount
buildNumber(Long)specific method, format the value as milliseconds of time.- Returns:
- This builder.
-
format
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
Build a Boolean. Displayed as "Yes/No" on the page.- Parameters:
value- true/false- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildBooleanProvidingCondition
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
Build a String.- Parameters:
value- any string. Limited to 50 characters.- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildComponent
Build aComponent.- Parameters:
value- aComponentmade byComponentService- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildNumber
Build a Number.- Parameters:
value- a non-floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildNumber
Build a Number.- Parameters:
value- a non-floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildNumber
Build a Number.- Parameters:
value- a non-floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildDouble
Build a Floating point number.- Parameters:
value- a floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildPercentage
Build a Percentage.- Parameters:
percentage- value between 0.0 and 1.0- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildGroup
Build a list of groups.- Parameters:
groups- names of groups a player is in.- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildTable
Build a table.- Parameters:
table- Table built usingTable.builder()tableColor- Color of the table- Returns:
- a data value to give to
ExtensionDataBuilder.
-
buildBoolean
Lambda version for conditional return or throwingNotReadyException. -
buildBooleanProvidingCondition
DataValue<Boolean> buildBooleanProvidingCondition(Supplier<Boolean> value, String providedCondition) Lambda version for conditional return or throwingNotReadyException. -
buildString
Lambda version for conditional return or throwingNotReadyException. -
buildComponent
Lambda version for conditional return or throwingNotReadyException. -
buildNumber
Lambda version for conditional return or throwingNotReadyException. -
buildDouble
Lambda version for conditional return or throwingNotReadyException. -
buildPercentage
Lambda version for conditional return or throwingNotReadyException. -
buildGroup
Lambda version for conditional return or throwingNotReadyException. -
buildTable
Lambda version for conditional return or throwingNotReadyException. -
hideFromUsers
Implementation detail - for abstracting annotations with the builder API.- Parameters:
annotation- BooleanProvider annotation.- Returns:
- This builder.
-
conditional
Implementation detail - for abstracting annotations with the builder API.- Parameters:
conditional- Conditional annotation.- Returns:
- This builder.
-
showAsPlayerPageLink
Implementation detail - for abstracting annotations with the builder API.- Parameters:
annotation- StringProvider annotation.- Returns:
- This builder.
-
methodName
Implementation detail - for abstracting annotations with the builder API.- Parameters:
method- Method this value is from.- Returns:
- This builder.
-
showInPlayerTable
Implementation detail - for abstracting annotations with the builder API.- Parameters:
show- true/false- Returns:
- This builder.
-
showOnTab
Implementation detail - for abstracting annotations with the builder API.- Parameters:
annotation- Tab annotation.- Returns:
- This builder.
-