Class NameApiModeFactory


  • public class NameApiModeFactory
    extends Object
    Provides Mode instances that contain the minimum.
    Author:
    Fabian Kessler
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.optimaize.command4j.Mode minimal​(String apiKey)
      Overloaded method that uses for host: new Host("api.nameapi.org", Protocol.HTTPS) for port url: NameApiPortUrlFactory.versionLatestStable()
      static com.optimaize.command4j.Mode minimal​(String apiKey, com.optimaize.anythingworks.common.host.Host host, com.optimaize.anythingworks.client.rest.RestPortUrlFactory portUrlFactory)
      You can take this and extend for your setup if you need more.
      static com.optimaize.command4j.Mode withContext​(String apiKey, org.nameapi.ontology5.input.context.Context context)
      Overloaded method that uses: for host: new Host("api.nameapi.org", Protocol.HTTPS) for port url: NameApiPortUrlFactory.versionLatestStable()
      static com.optimaize.command4j.Mode withContext​(String apiKey, org.nameapi.ontology5.input.context.Context context, com.optimaize.anythingworks.common.host.Host host, com.optimaize.anythingworks.client.rest.RestPortUrlFactory portUrlFactory)
      You can take this and extend for your setup if you need more.
    • Constructor Detail

      • NameApiModeFactory

        public NameApiModeFactory()
    • Method Detail

      • minimal

        @NotNull
        public static com.optimaize.command4j.Mode minimal​(@NotNull
                                                           String apiKey,
                                                           @NotNull
                                                           com.optimaize.anythingworks.common.host.Host host,
                                                           @NotNull
                                                           com.optimaize.anythingworks.client.rest.RestPortUrlFactory portUrlFactory)
        You can take this and extend for your setup if you need more.

        Example: .with(StdoutLoggingExtension.enabled())

        Parameters:
        apiKey - Your personal api key from registering with us.
        host - for example new Host("api.nameapi.org", Protocol.HTTPS)
        portUrlFactory - for example NameApiPortUrlFactory.versionLatestStable()
      • minimal

        @NotNull
        public static com.optimaize.command4j.Mode minimal​(@NotNull
                                                           String apiKey)
        Overloaded method that uses for host: new Host("api.nameapi.org", Protocol.HTTPS) for port url: NameApiPortUrlFactory.versionLatestStable()
      • withContext

        @NotNull
        public static com.optimaize.command4j.Mode withContext​(@NotNull
                                                               String apiKey,
                                                               @NotNull
                                                               org.nameapi.ontology5.input.context.Context context,
                                                               @NotNull
                                                               com.optimaize.anythingworks.common.host.Host host,
                                                               @NotNull
                                                               com.optimaize.anythingworks.client.rest.RestPortUrlFactory portUrlFactory)
        You can take this and extend for your setup if you need more.

        Example: .with(StdoutLoggingExtension.enabled())

        Parameters:
        apiKey - Your personal api key from registering with us.
        context - for example new ContextBuilder().priority(Priority.REALTIME).build()
        host - for example new Host("api.nameapi.org", Protocol.HTTPS)
        portUrlFactory - for example NameApiPortUrlFactory.versionLatestStable()
      • withContext

        @NotNull
        public static com.optimaize.command4j.Mode withContext​(@NotNull
                                                               String apiKey,
                                                               @NotNull
                                                               org.nameapi.ontology5.input.context.Context context)
        Overloaded method that uses: for host: new Host("api.nameapi.org", Protocol.HTTPS) for port url: NameApiPortUrlFactory.versionLatestStable()