Class Criteria.Builder<I,​O>

  • Enclosing class:
    Criteria<I,​O>

    public static final class Criteria.Builder<I,​O>
    extends java.lang.Object
    A Builder to construct a Criteria.
    • Method Detail

      • setTypes

        public <P,​Q> Criteria.Builder<P,​Q> setTypes​(java.lang.Class<P> inputClass,
                                                                java.lang.Class<Q> outputClass)
        Creates a new @{code Builder} class with the specified input and output data type.
        Type Parameters:
        P - the input data type
        Q - the output data type
        Parameters:
        inputClass - the input class
        outputClass - the output class
        Returns:
        a new @{code Builder} class with the specified input and output data type
      • optApplication

        public Criteria.Builder<I,​O> optApplication​(Application application)
        Sets the model application for this criteria.
        Parameters:
        application - the model application
        Returns:
        this Builder
      • optEngine

        public Criteria.Builder<I,​O> optEngine​(java.lang.String engine)
        Sets the engine name for this criteria.
        Parameters:
        engine - the engine name
        Returns:
        this Builder
      • optDevice

        public Criteria.Builder<I,​O> optDevice​(Device device)
        Sets the Device for this criteria.
        Parameters:
        device - the Device for the criteria
        Returns:
        this Builder
      • optGroupId

        public Criteria.Builder<I,​O> optGroupId​(java.lang.String groupId)
        Sets optional groupId of the ModelZoo for this criteria.
        Parameters:
        groupId - the groupId of the ModelZoo
        Returns:
        this Builder
      • optArtifactId

        public Criteria.Builder<I,​O> optArtifactId​(java.lang.String artifactId)
        Sets optional artifactId of the ModelLoader for this criteria.
        Parameters:
        artifactId - the artifactId of the ModelLoader
        Returns:
        this Builder
      • optModelUrls

        public Criteria.Builder<I,​O> optModelUrls​(java.lang.String modelUrls)
        Sets optional model urls of the ModelLoader for this criteria.
        Parameters:
        modelUrls - the comma delimited url string
        Returns:
        this Builder
      • optModelPath

        public Criteria.Builder<I,​O> optModelPath​(java.nio.file.Path modelPath)
        Sets the optional model path of the ModelLoader for this criteria.
        Parameters:
        modelPath - the path to the model folder/files
        Returns:
        this Builder
      • optFilters

        public Criteria.Builder<I,​O> optFilters​(java.util.Map<java.lang.String,​java.lang.String> filters)
        Sets the extra search filters for this criteria.
        Parameters:
        filters - the extra search filters
        Returns:
        this Builder
      • optFilter

        public Criteria.Builder<I,​O> optFilter​(java.lang.String key,
                                                     java.lang.String value)
        Sets an extra search filter for this criteria.
        Parameters:
        key - the search key
        value - the search value
        Returns:
        this Builder
      • optBlock

        public Criteria.Builder<I,​O> optBlock​(Block block)
        Sets an optional model Block for this criteria.
        Parameters:
        block - optional model Block for this criteria
        Returns:
        this Builder
      • optModelName

        public Criteria.Builder<I,​O> optModelName​(java.lang.String modelName)
        Sets an optional model name for this criteria.
        Parameters:
        modelName - optional model name for this criteria
        Returns:
        this Builder
      • optArguments

        public Criteria.Builder<I,​O> optArguments​(java.util.Map<java.lang.String,​java.lang.Object> arguments)
        Sets an extra model loading argument for this criteria.
        Parameters:
        arguments - optional model loading arguments
        Returns:
        this Builder
      • optArgument

        public Criteria.Builder<I,​O> optArgument​(java.lang.String key,
                                                       java.lang.Object value)
        Sets the optional model loading argument for this criteria.
        Parameters:
        key - the model loading argument key
        value - the model loading argument value
        Returns:
        this Builder
      • optOptions

        public Criteria.Builder<I,​O> optOptions​(java.util.Map<java.lang.String,​java.lang.String> options)
        Sets the model loading options for this criteria.
        Parameters:
        options - the model loading options
        Returns:
        this Builder
      • optOption

        public Criteria.Builder<I,​O> optOption​(java.lang.String key,
                                                     java.lang.String value)
        Sets the optional model loading option for this criteria.
        Parameters:
        key - the model loading option key
        value - the model loading option value
        Returns:
        this Builder
      • optTranslator

        public Criteria.Builder<I,​O> optTranslator​(Translator<I,​O> translator)
        Sets the optional Translator to override default Translator.
        Parameters:
        translator - the override Translator
        Returns:
        this Builder
      • optProgress

        public Criteria.Builder<I,​O> optProgress​(ai.djl.util.Progress progress)
        Set the optional Progress.
        Parameters:
        progress - the Progress
        Returns:
        this Builder