Class DataComponentValueConverterRegistry
java.lang.Object
net.kyori.adventure.text.event.DataComponentValueConverterRegistry
A registry for conversions between different data component value holder classes.
Conversions are discovered by ServiceLoader lookup of implementations of the DataComponentValueConverterRegistry.Provider interface (on the classloader which loaded Adventure).
- Since:
- 4.17.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA single conversion that may be provided by a provider.static interfaceA provider for data component value converters. -
Method Summary
Modifier and TypeMethodDescriptionstatic <O extends DataComponentValue>
Oconvert(Class<O> target, Key key, DataComponentValue in) Try to convert the data component valueinto the provided output type.Get the id's of all registered conversion providers.
-
Method Details
-
knownProviders
-
convert
public static <O extends DataComponentValue> O convert(Class<O> target, Key key, DataComponentValue in) Try to convert the data component valueinto the provided output type.- Type Parameters:
O- the output type- Parameters:
target- the target typekey- the key this value is forin- the input value- Returns:
- a value of target type
- Since:
- 4.17.0
-