Class ChainedConverter<F,​M,​T>

java.lang.Object
ch.njol.skript.classes.ChainedConverter<F,​M,​T>
Type Parameters:
F - same as Converter's (from)
M - the middle type, i.e. the type the first converter converts to and the second converter comverts from.
T - same as Converter's (to)
All Implemented Interfaces:
Converter<F,​T>

public final class ChainedConverter<F,​M,​T> extends Object implements Converter<F,​T>
Used to chain convertes to build a single converter. This is automatically created when a new converter is added.
See Also:
Converters.registerConverter(Class, Class, Converter), Converter
  • Constructor Details

    • ChainedConverter

      public ChainedConverter(Converter<? super F,​? extends M> first, Converter<? super M,​? extends T> second)
  • Method Details

    • newInstance

      public static <F,​ M,​ T> ChainedConverter<F,​M,​T> newInstance(Converter<? super F,​?> first, Converter<?,​? extends T> second)
    • convert

      public @Nullable T convert(F f)
      Description copied from interface: Converter
      Converts an object from the given to the desired type.
      Specified by:
      convert in interface Converter<F,​M>
      Parameters:
      f - The object to convert.
      Returns:
      the converted object
    • toString

      public String toString()
      Overrides:
      toString in class Object