Module net.kyori.adventure.api
Package net.kyori.adventure.text.event
Interface DataComponentValueConverterRegistry.Conversion<I,O>
- Type Parameters:
I- input typeO- output type
- Enclosing class:
DataComponentValueConverterRegistry
public static sealed interface DataComponentValueConverterRegistry.Conversion<I,O>
A single conversion that may be provided by a provider.
- Since:
- 4.17.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <I1,O1> DataComponentValueConverterRegistry.Conversion <I1, O1> convert(Class<I1> src, Class<O1> dst, BiFunction<Key, I1, O1> op) Create a new conversion.Perform the actual conversion.The destination type.source()The source type.
-
Method Details
-
convert
static <I1,O1> DataComponentValueConverterRegistry.Conversion<I1,O1> convert(Class<I1> src, Class<O1> dst, BiFunction<Key, I1, O1> op) Create a new conversion.- Type Parameters:
I1- the input typeO1- the output type- Parameters:
src- the source typedst- the destination typeop- the conversion operation- Returns:
- a conversion object
- Since:
- 4.17.0
-
source
The source type.- Returns:
- the source type
- Since:
- 4.17.0
-
destination
The destination type.- Returns:
- the destination type
- Since:
- 4.17.0
-
convert
Perform the actual conversion.- Parameters:
key- the key used for the data holderinput- the source type- Returns:
- a data holder of the destination type
- Since:
- 4.17.0
-