Package org.instancio.generator.specs
Interface URLSpec
- All Superinterfaces:
GeneratorSpec<URL>
,URLGeneratorSpec
,ValueSpec<URL>
- All Known Implementing Classes:
URLGenerator
Spec for generating
URL
values.- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies a generator for the file name.Specifies a generator for the host name.nullable()
Specifies that anull
value can be generatedport
(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
Description copied from interface:URLGeneratorSpec
Generate a random protocol from the given choices. If not specified, the default is HTTP.- Specified by:
protocol
in interfaceURLGeneratorSpec
- Parameters:
protocols
- one or more values from which a random protocol will be selected- Returns:
- spec builder
-
port
Description copied from interface:URLGeneratorSpec
Specifies the port number. If not specified, default port-1
will be used.- Specified by:
port
in interfaceURLGeneratorSpec
- 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 interfaceURLGeneratorSpec
- Returns:
- spec builder
-
host
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 interfaceURLGeneratorSpec
- Parameters:
hostGenerator
- generator for the host name- Returns:
- spec builder
-
file
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 interfaceURLGeneratorSpec
- Parameters:
fileGenerator
- generator for the file- Returns:
- spec builder
-
nullable
URLSpec nullable()Description copied from interface:ValueSpec
Specifies that anull
value can be generated
-