Package org.instancio.generator.specs
Interface URIGeneratorSpec
- All Superinterfaces:
GeneratorSpec<URI>,NullableGeneratorSpec<URI>
- All Known Subinterfaces:
URIAsGeneratorSpec,URISpec
Generator spec for
URI.- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies a generator for the fragmentGenerator.Specifies a generator for the host name.nullable()Indicates thatnullvalue can be generated.Specifies a generator for the path.port(int port) Specifies the port number.Specifies a generator for the query.Specifies that a random port number between 1 and 65535 (inclusive) should be generated.Generate a random scheme from the given choices.Specifies username.
-
Method Details
-
scheme
Generate a random scheme from the given choices. If not specified, the default is HTTP.- Parameters:
schemes- one or more values from which a random scheme will be selected- Returns:
- spec builder
- Since:
- 2.3.0
-
userInfo
Specifies username. If not specified, anulluser will be generated.- Parameters:
userInfo- username to generate- 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
-
port
Specifies the port number. If not specified, default port-1will be used.- Parameters:
port- port number to use- Returns:
- spec builder
- Since:
- 2.3.0
-
randomPort
URIGeneratorSpec randomPort()Specifies that a random port number between 1 and 65535 (inclusive) should be generated.- Returns:
- spec builder
- Since:
- 2.3.0
-
path
Specifies a generator for the path. If not specified,nullpath will be generated.- Parameters:
pathGenerator- generator for the path- Returns:
- spec builder
- Since:
- 2.3.0
-
query
Specifies a generator for the query. If not specified,nullquery will be generated.- Parameters:
queryGenerator- generator for the query- Returns:
- spec builder
- Since:
- 2.3.0
-
fragment
Specifies a generator for the fragmentGenerator. If not specified,nullfragmentGenerator will be generated.- Parameters:
fragmentGenerator- generator for the fragment- Returns:
- spec builder
- Since:
- 2.3.0
-
nullable
URIGeneratorSpec nullable()Indicates thatnullvalue can be generated.- Specified by:
nullablein interfaceNullableGeneratorSpec<URI>- Returns:
- spec builder
- Since:
- 3.2.0
-