Interface URLGeneratorSpec

All Superinterfaces:
GeneratorSpec<URL>, NullableGeneratorSpec<URL>
All Known Subinterfaces:
URLAsGeneratorSpec, URLSpec

public interface URLGeneratorSpec extends NullableGeneratorSpec<URL>
Generator spec for URL.
Since:
2.3.0
  • Method Details

    • protocol

      URLGeneratorSpec protocol(String... protocols)
      Generate a random protocol from the given choices. If not specified, the default is HTTP.
      Parameters:
      protocols - one or more values from which a random protocol will be selected
      Returns:
      spec builder
      Since:
      2.3.0
    • port

      URLGeneratorSpec port(int port)
      Specifies the port number. If not specified, default port -1 will be used.
      Parameters:
      port - port number to use
      Returns:
      spec builder
      Since:
      2.3.0
    • randomPort

      URLGeneratorSpec randomPort()
      Specifies that a random port number between 1 and 65535 (inclusive) should be generated.
      Returns:
      spec builder
      Since:
      2.3.0
    • host

      URLGeneratorSpec host(Generator<String> hostGenerator)
      Specifies a generator for the host name. If not specified, a random host name will be generated.
      Parameters:
      hostGenerator - generator for the host name
      Returns:
      spec builder
      Since:
      2.3.0
    • file

      URLGeneratorSpec file(Generator<String> fileGenerator)
      Specifies a generator for the file name. If not specified, blank file name will be used.
      Parameters:
      fileGenerator - generator for the file
      Returns:
      spec builder
      Since:
      2.3.0
    • nullable

      URLGeneratorSpec nullable()
      Indicates that null value can be generated.
      Specified by:
      nullable in interface NullableGeneratorSpec<URL>
      Returns:
      spec builder
      Since:
      3.2.0