Class URIGenerator
java.lang.Object
org.instancio.internal.generator.AbstractGenerator<T>
org.instancio.internal.generator.net.URIGenerator
- All Implemented Interfaces:
AsStringGeneratorSpec<URI>
,Generator<URI>
,GeneratorSpec<URI>
,URIGeneratorSpec
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the public API method name of the generator spec.Specifies a generator for the fragmentGenerator.Returns a generated value.Specifies a generator for the host name.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.Methods inherited from class org.instancio.internal.generator.AbstractGenerator
getContext, hints
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.instancio.generator.AsStringGeneratorSpec
asString, asString
-
Constructor Details
-
URIGenerator
-
-
Method Details
-
apiMethod
Description copied from class:AbstractGenerator
Returns the public API method name of the generator spec. The returned name is used for reporting validation errors.- Specified by:
apiMethod
in classAbstractGenerator<URI>
- Returns:
- spec name if defined, or
null
otherwise
-
scheme
Description copied from interface:URIGeneratorSpec
Generate a random scheme from the given choices. If not specified, the default is HTTP.- Specified by:
scheme
in interfaceURIGeneratorSpec
- Parameters:
schemes
- one or more values from which a random scheme will be selected- Returns:
- spec builder
-
userInfo
Description copied from interface:URIGeneratorSpec
Specifies username. If not specified, anull
user will be generated.- Specified by:
userInfo
in interfaceURIGeneratorSpec
- Parameters:
userInfo
- username to generate- Returns:
- spec builder
-
host
Description copied from interface:URIGeneratorSpec
Specifies a generator for the host name. If not specified, a random host name will be generated.- Specified by:
host
in interfaceURIGeneratorSpec
- Parameters:
hostGenerator
- generator for the host name- Returns:
- spec builder
-
port
Description copied from interface:URIGeneratorSpec
Specifies the port number. If not specified, default port-1
will be used.- Specified by:
port
in interfaceURIGeneratorSpec
- Parameters:
port
- port number to use- Returns:
- spec builder
-
randomPort
Description copied from interface:URIGeneratorSpec
Specifies that a random port number between 1 and 65535 (inclusive) should be generated.- Specified by:
randomPort
in interfaceURIGeneratorSpec
- Returns:
- spec builder
-
path
Description copied from interface:URIGeneratorSpec
Specifies a generator for the path. If not specified,null
path will be generated.- Specified by:
path
in interfaceURIGeneratorSpec
- Parameters:
path
- generator for the path- Returns:
- spec builder
-
query
Description copied from interface:URIGeneratorSpec
Specifies a generator for the query. If not specified,null
query will be generated.- Specified by:
query
in interfaceURIGeneratorSpec
- Parameters:
queryGenerator
- generator for the query- Returns:
- spec builder
-
fragment
Description copied from interface:URIGeneratorSpec
Specifies a generator for the fragmentGenerator. If not specified,null
fragmentGenerator will be generated.- Specified by:
fragment
in interfaceURIGeneratorSpec
- Parameters:
fragmentGenerator
- generator for the fragment- Returns:
- spec builder
-
generate
Description copied from interface:Generator
Returns a generated value.If this method produces random data, the data needs to be generated using the provided
Random
instance. This ensures generated values are reproducible for a given seed value.
-