Class ExtValueBuilder
- java.lang.Object
-
- com.djrapitops.plan.extension.implementation.builder.ExtValueBuilder
-
- All Implemented Interfaces:
ValueBuilder
public class ExtValueBuilder extends java.lang.Object implements ValueBuilder
-
-
Constructor Summary
Constructors Constructor Description ExtValueBuilder(java.lang.String text, DataExtension extension)
-
Method Summary
All Methods Instance Methods Concrete 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 value)
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)
ValueBuilder.buildNumber(long)
specific method, format the value withFormatType
ValueBuilder
hideFromUsers(BooleanProvider annotation)
Implementation detail - for abstracting annotations with the builder API.ValueBuilder
icon(Icon icon)
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()
ValueBuilder.buildString(String)
specific method, link the value to a player page.ValueBuilder
showInPlayerTable()
Show this value in the players table.ValueBuilder
showOnTab(java.lang.String tabName)
Show the value on a specific tab.-
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.ValueBuilder
formatAsDateWithSeconds, formatAsDateWithYear, formatAsTimeAmount, icon, showAsPlayerPageLink, showInPlayerTable, showOnTab
-
-
-
-
Constructor Detail
-
ExtValueBuilder
public ExtValueBuilder(java.lang.String text, DataExtension extension)
-
-
Method Detail
-
methodName
public ValueBuilder methodName(ExtensionMethod method)
Description copied from interface:ValueBuilder
Implementation detail - for abstracting annotations with the builder API.- Specified by:
methodName
in interfaceValueBuilder
- Parameters:
method
- Method this value is from.- Returns:
- This builder.
-
description
public ValueBuilder description(java.lang.String description)
Description copied from interface:ValueBuilder
Description about the value that is shown on hover.- Specified by:
description
in interfaceValueBuilder
- Parameters:
description
- Describe what the value is about, maximum 150 characters.- Returns:
- This builder.
-
priority
public ValueBuilder priority(int priority)
Description copied from interface:ValueBuilder
Display-priority of the value, highest value is placed top most.Two values with same priority may appear in a random order.
- Specified by:
priority
in interfaceValueBuilder
- Parameters:
priority
- Priority between 0 andInteger.MAX_VALUE
.- Returns:
- This builder.
-
showInPlayerTable
public ValueBuilder showInPlayerTable()
Description copied from interface:ValueBuilder
Show this value in the players table.- Specified by:
showInPlayerTable
in interfaceValueBuilder
- Returns:
- This builder.
-
icon
public ValueBuilder icon(Icon icon)
Description copied from interface:ValueBuilder
Icon displayed next to the value.See https://fontawesome.com/icons (select 'free')) for icons
- Specified by:
icon
in interfaceValueBuilder
- Parameters:
icon
- Icon built using the methods inIcon
.- Returns:
- This builder.
-
showOnTab
public ValueBuilder showOnTab(java.lang.String tabName)
Description copied from interface:ValueBuilder
Show the value on a specific tab.Remember to define
TabInfo
annotation.- Specified by:
showOnTab
in interfaceValueBuilder
- Parameters:
tabName
- Name of the tab.- Returns:
- This builder.
-
format
public ValueBuilder format(FormatType formatType)
Description copied from interface:ValueBuilder
ValueBuilder.buildNumber(long)
specific method, format the value withFormatType
- Specified by:
format
in interfaceValueBuilder
- Returns:
- This builder.
-
showAsPlayerPageLink
public ValueBuilder showAsPlayerPageLink()
Description copied from interface:ValueBuilder
ValueBuilder.buildString(String)
specific method, link the value to a player page.- Specified by:
showAsPlayerPageLink
in interfaceValueBuilder
- Returns:
- This builder.
-
hideFromUsers
public ValueBuilder hideFromUsers(BooleanProvider annotation)
Description copied from interface:ValueBuilder
Implementation detail - for abstracting annotations with the builder API.- Specified by:
hideFromUsers
in interfaceValueBuilder
- Parameters:
annotation
- BooleanProvider annotation.- Returns:
- This builder.
-
conditional
public ValueBuilder conditional(Conditional conditional)
Description copied from interface:ValueBuilder
Implementation detail - for abstracting annotations with the builder API.- Specified by:
conditional
in interfaceValueBuilder
- Parameters:
conditional
- Conditional annotation.- Returns:
- This builder.
-
buildBoolean
public DataValue<java.lang.Boolean> buildBoolean(boolean value)
Description copied from interface:ValueBuilder
Build a Boolean. Displayed as "Yes/No" on the page.- Specified by:
buildBoolean
in interfaceValueBuilder
- Parameters:
value
- true/false- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildBooleanProvidingCondition
public DataValue<java.lang.Boolean> buildBooleanProvidingCondition(boolean value, java.lang.String providedCondition)
Description copied from interface:ValueBuilder
Build a Boolean that provides a value forConditional
. Displayed as "Yes/No" on the page.- Specified by:
buildBooleanProvidingCondition
in interfaceValueBuilder
- Parameters:
value
- true/false- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildString
public DataValue<java.lang.String> buildString(java.lang.String value)
Description copied from interface:ValueBuilder
Build a String.- Specified by:
buildString
in interfaceValueBuilder
- Parameters:
value
- any string. Limited to 50 characters.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildNumber
public DataValue<java.lang.Long> buildNumber(long value)
Description copied from interface:ValueBuilder
Build a Number.- Specified by:
buildNumber
in interfaceValueBuilder
- Parameters:
value
- a non-floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildDouble
public DataValue<java.lang.Double> buildDouble(double value)
Description copied from interface:ValueBuilder
Build a Floating point number.- Specified by:
buildDouble
in interfaceValueBuilder
- Parameters:
value
- a floating point number.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildPercentage
public DataValue<java.lang.Double> buildPercentage(double value)
Description copied from interface:ValueBuilder
Build a Percentage.- Specified by:
buildPercentage
in interfaceValueBuilder
- Parameters:
value
- value between 0.0 and 1.0- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildGroup
public DataValue<java.lang.String[]> buildGroup(java.lang.String[] groups)
Description copied from interface:ValueBuilder
Build a list of groups.- Specified by:
buildGroup
in interfaceValueBuilder
- Parameters:
groups
- names of groups a player is in.- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildBoolean
public DataValue<java.lang.Boolean> buildBoolean(java.util.function.Supplier<java.lang.Boolean> value)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.- Specified by:
buildBoolean
in interfaceValueBuilder
-
buildBooleanProvidingCondition
public DataValue<java.lang.Boolean> buildBooleanProvidingCondition(java.util.function.Supplier<java.lang.Boolean> value, java.lang.String providedCondition)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildBooleanProvidingCondition(boolean, String)
- Specified by:
buildBooleanProvidingCondition
in interfaceValueBuilder
-
buildString
public DataValue<java.lang.String> buildString(java.util.function.Supplier<java.lang.String> value)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildString(String)
- Specified by:
buildString
in interfaceValueBuilder
-
buildNumber
public DataValue<java.lang.Long> buildNumber(java.util.function.Supplier<java.lang.Long> value)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildNumber(long)
- Specified by:
buildNumber
in interfaceValueBuilder
-
buildDouble
public DataValue<java.lang.Double> buildDouble(java.util.function.Supplier<java.lang.Double> value)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildDouble(double)
- Specified by:
buildDouble
in interfaceValueBuilder
-
buildPercentage
public DataValue<java.lang.Double> buildPercentage(java.util.function.Supplier<java.lang.Double> percentage)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildPercentage(double)
- Specified by:
buildPercentage
in interfaceValueBuilder
-
buildGroup
public DataValue<java.lang.String[]> buildGroup(java.util.function.Supplier<java.lang.String[]> groups)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildGroup(String[])
- Specified by:
buildGroup
in interfaceValueBuilder
-
buildTable
public DataValue<Table> buildTable(Table table, Color tableColor)
Description copied from interface:ValueBuilder
Build a table.- Specified by:
buildTable
in interfaceValueBuilder
- Parameters:
table
- Table built usingTable.builder()
tableColor
- Color of the table- Returns:
- a data value to give to
ExtensionDataBuilder
.
-
buildTable
public DataValue<Table> buildTable(java.util.function.Supplier<Table> table, Color tableColor)
Description copied from interface:ValueBuilder
Lambda version for conditional return or throwingNotReadyException
.ValueBuilder.buildTable(Table, Color)
- Specified by:
buildTable
in interfaceValueBuilder
-
-