Interface TranslatorOptions


public interface TranslatorOptions
A set of possible options for Translators with different input and output types.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<ai.djl.util.Pair<Type,Type>>
    Returns the supported wrap types.
    default boolean
    isSupported(Class<?> input, Class<?> output)
    Returns if the input/output is a supported wrap type.
    <I, O> Translator<I,O>
    option(Class<I> input, Class<O> output)
    Returns the Translator option with the matching input and output type.
  • Method Details

    • getOptions

      Set<ai.djl.util.Pair<Type,Type>> getOptions()
      Returns the supported wrap types.
      Returns:
      the supported wrap types
      See Also:
    • isSupported

      default boolean isSupported(Class<?> input, Class<?> output)
      Returns if the input/output is a supported wrap type.
      Parameters:
      input - the input class
      output - the output class
      Returns:
      true if the input/output type is supported
      See Also:
    • option

      <I, O> Translator<I,O> option(Class<I> input, Class<O> output) throws TranslateException
      Returns the Translator option with the matching input and output type.
      Type Parameters:
      I - the input data type
      O - the output data type
      Parameters:
      input - the input class
      output - the output class
      Returns:
      a new instance of the Translator class
      Throws:
      TranslateException - if failed to create Translator instance