Plan API 5.2-R0.8: Reduced builder compiler errors

This commit is contained in:
Risto Lahtela 2021-04-17 09:40:07 +03:00
parent 9bf0838026
commit 2247b9099c
2 changed files with 27 additions and 7 deletions

View File

@ -4,7 +4,7 @@ dependencies {
compileOnly "com.google.code.gson:gson:$gsonVersion"
}
ext.apiVersion = '5.2-R0.7'
ext.apiVersion = '5.2-R0.8'
publishing {
repositories {

View File

@ -170,6 +170,26 @@ public interface ValueBuilder {
*/
DataValue<Long> buildNumber(Long value);
/**
* Build a Number.
*
* @param value a non-floating point number.
* @return a data value to give to {@link ExtensionDataBuilder}.
*/
default DataValue<Long> buildNumber(Integer value) {
return buildNumber(value != null ? (long) value : null);
}
/**
* Build a Number.
*
* @param value a non-floating point number.
* @return a data value to give to {@link ExtensionDataBuilder}.
*/
default DataValue<Long> buildNumber(Double value) {
return buildNumber(value != null ? (long) (double) value : null);
}
/**
* Build a Floating point number.
*
@ -212,14 +232,14 @@ public interface ValueBuilder {
/**
* Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}.
*
* <p>
* {@link ValueBuilder#buildBooleanProvidingCondition(boolean, String)}
*/
DataValue<Boolean> buildBooleanProvidingCondition(Supplier<Boolean> value, String providedCondition);
/**
* Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}.
*
* <p>
* {@link ValueBuilder#buildString(String)}
*/
DataValue<String> buildString(Supplier<String> value);
@ -233,28 +253,28 @@ public interface ValueBuilder {
/**
* Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}.
*
* <p>
* {@link ValueBuilder#buildDouble(Double)}
*/
DataValue<Double> buildDouble(Supplier<Double> value);
/**
* Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}.
*
* <p>
* {@link ValueBuilder#buildPercentage(Double)}
*/
DataValue<Double> buildPercentage(Supplier<Double> percentage);
/**
* Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}.
*
* <p>
* {@link ValueBuilder#buildGroup(String[])}
*/
DataValue<String[]> buildGroup(Supplier<String[]> groups);
/**
* Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}.
*
* <p>
* {@link ValueBuilder#buildTable(Table, Color)}
*/
DataValue<Table> buildTable(Supplier<Table> table, Color tableColor);