Package org.instancio.generator.specs
Interface URLAsGeneratorSpec
- All Superinterfaces:
AsGeneratorSpec<URL>,GeneratorSpec<URL>,NullableGeneratorSpec<URL>,URLGeneratorSpec
Generator spec for
URL values that supports AsGeneratorSpec.- Since:
- 2.6.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.Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asStringMethods inherited from interface org.instancio.generator.specs.URLGeneratorSpec
nullable
-
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
URLAsGeneratorSpec 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
-