Package org.instancio.generator.specs
Interface URLSpec
- All Superinterfaces:
AsGeneratorSpec<URL>,GeneratorSpec<URL>,NullableGeneratorSpec<URL>,Supplier<URL>,URLGeneratorSpec,ValueSpec<URL>
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 anullvalue 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.Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
-
Method Details
-
protocol
Description copied from interface:URLGeneratorSpecGenerate a random protocol from the given choices. If not specified, the default is HTTP.- Specified by:
protocolin interfaceURLGeneratorSpec- Parameters:
protocols- one or more values from which a random protocol will be selected- Returns:
- spec builder
-
port
Description copied from interface:URLGeneratorSpecSpecifies the port number. If not specified, default port-1will be used.- Specified by:
portin interfaceURLGeneratorSpec- Parameters:
port- port number to use- Returns:
- spec builder
-
randomPort
URLSpec randomPort()Description copied from interface:URLGeneratorSpecSpecifies that a random port number between 1 and 65535 (inclusive) should be generated.- Specified by:
randomPortin interfaceURLGeneratorSpec- Returns:
- spec builder
-
host
Description copied from interface:URLGeneratorSpecSpecifies a generator for the host name. If not specified, a random host name will be generated.- Specified by:
hostin interfaceURLGeneratorSpec- Parameters:
hostGenerator- generator for the host name- Returns:
- spec builder
-
file
Description copied from interface:URLGeneratorSpecSpecifies a generator for the file name. If not specified, blank file name will be used.- Specified by:
filein interfaceURLGeneratorSpec- Parameters:
fileGenerator- generator for the file- Returns:
- spec builder
-
nullable
URLSpec nullable()Description copied from interface:ValueSpecSpecifies that anullvalue can be generated- Specified by:
nullablein interfaceNullableGeneratorSpec<URL>- Specified by:
nullablein interfaceURLGeneratorSpec- Specified by:
nullablein interfaceValueSpec<URL>- Returns:
- spec builder reference
-