Package org.instancio.generator.specs
Interface URLGeneratorSpec
- All Superinterfaces:
GeneratorSpec<URL>
- All Known Subinterfaces:
URLAsGeneratorSpec
,URLSpec
- All Known Implementing Classes:
URLGenerator
Generator spec for
URL
.- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies a generator for the file name.Specifies a generator for the host name.port
(int port) Specifies the port number.Generate a random protocol from the given choices.Specifies that a random port number between 1 and 65535 (inclusive) should be generated.
-
Method Details
-
protocol
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
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
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
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
-