Interface DataComponentValueConverterRegistry.Conversion<I,O>

Type Parameters:
I - input type
O - output type
All Superinterfaces:
net.kyori.examination.Examinable
Enclosing class:
DataComponentValueConverterRegistry

@NonExtendable public static interface DataComponentValueConverterRegistry.Conversion<I,O> extends net.kyori.examination.Examinable
A single conversion that may be provided by a provider.
Since:
4.17.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static <I1, O1> @NotNull DataComponentValueConverterRegistry.Conversion<I1,O1>
    convert(@NotNull Class<I1> src, @NotNull Class<O1> dst, @NotNull BiFunction<Key,I1,O1> op)
    Create a new conversion.
    convert(@NotNull Key key, I input)
    Perform the actual conversion.
    @NotNull Class<O>
    The destination type.
    @NotNull Class<I>
    The source type.

    Methods inherited from interface net.kyori.examination.Examinable

    examinableName, examinableProperties, examine
  • Method Details

    • convert

      @NotNull static <I1, O1> @NotNull DataComponentValueConverterRegistry.Conversion<I1,O1> convert(@NotNull @NotNull Class<I1> src, @NotNull @NotNull Class<O1> dst, @NotNull @NotNull BiFunction<Key,I1,O1> op)
      Create a new conversion.
      Type Parameters:
      I1 - the input type
      O1 - the output type
      Parameters:
      src - the source type
      dst - the destination type
      op - the conversion operation
      Returns:
      a conversion object
      Since:
      4.17.0
    • source

      @Contract(pure=true) @NotNull @NotNull Class<I> source()
      The source type.
      Returns:
      the source type
      Since:
      4.17.0
    • destination

      @Contract(pure=true) @NotNull @NotNull Class<O> destination()
      The destination type.
      Returns:
      the destination type
      Since:
      4.17.0
    • convert

      @NotNull O convert(@NotNull @NotNull Key key, @NotNull I input)
      Perform the actual conversion.
      Parameters:
      key - the key used for the data holder
      input - the source type
      Returns:
      a data holder of the destination type
      Since:
      4.17.0