Interface URLSpec

All Superinterfaces:
GeneratorSpec<URL>, NullableGeneratorSpec<URL>, URLGeneratorSpec, ValueSpec<URL>

public interface URLSpec extends ValueSpec<URL>, URLGeneratorSpec
Spec for generating URL values.
Since:
2.6.0
  • Method Details

    • protocol

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

      URLSpec port(int port)
      Description copied from interface: URLGeneratorSpec
      Specifies the port number. If not specified, default port -1 will be used.
      Specified by:
      port in interface URLGeneratorSpec
      Parameters:
      port - port number to use
      Returns:
      spec builder
    • randomPort

      URLSpec randomPort()
      Description copied from interface: URLGeneratorSpec
      Specifies that a random port number between 1 and 65535 (inclusive) should be generated.
      Specified by:
      randomPort in interface URLGeneratorSpec
      Returns:
      spec builder
    • host

      URLSpec host(Generator<String> hostGenerator)
      Description copied from interface: URLGeneratorSpec
      Specifies a generator for the host name. If not specified, a random host name will be generated.
      Specified by:
      host in interface URLGeneratorSpec
      Parameters:
      hostGenerator - generator for the host name
      Returns:
      spec builder
    • file

      URLSpec file(Generator<String> fileGenerator)
      Description copied from interface: URLGeneratorSpec
      Specifies a generator for the file name. If not specified, blank file name will be used.
      Specified by:
      file in interface URLGeneratorSpec
      Parameters:
      fileGenerator - generator for the file
      Returns:
      spec builder
    • nullable

      URLSpec nullable()
      Description copied from interface: ValueSpec
      Specifies that a null value can be generated
      Specified by:
      nullable in interface NullableGeneratorSpec<URL>
      Specified by:
      nullable in interface URLGeneratorSpec
      Specified by:
      nullable in interface ValueSpec<URL>
      Returns:
      spec builder reference