Class URIGenerator

All Implemented Interfaces:
Generator, TypedGenerator<URI>

@API(status=STABLE, since="0.1") @Priority(-1000) public class URIGenerator extends AbstractTypedGenerator<URI>
Generator of URI values.
Since:
0.1
Version:
1.0, 2022-11
Author:
(w) Iker Hernaez
See Also:
  • Field Details

    • DEFAULT_VALUE

      public static final URI DEFAULT_VALUE
      The default value.
  • Constructor Details

    • URIGenerator

      public URIGenerator()
      Creates a new instance.
  • Method Details

    • defaultValue

      @NotNull public @NotNull URI defaultValue()
      Returns the default value of the supported type.
      Returns:
      The default value.
    • randomValue

      @NotNull public @NotNull URI randomValue()
      Returns a random value of the supported type.
      Returns:
      A random value.
    • randomScheme

      @NotNull public static @NotNull String randomScheme()
      Returns a random scheme.
      Returns:
      The random scheme
    • randomUserInfo

      @NotNull public static @NotNull String randomUserInfo()
      Returns a random user info part of an URI.
      Returns:
      The random user info
    • randomOptionalUserInfo

      public static String randomOptionalUserInfo()
      Returns a random optional user info part of an URI.
      Returns:
      The random user info, or null
    • randomDomainLabel

      @NotNull protected static @NotNull String randomDomainLabel()
      Returns a random non top domain label.
      Returns:
      The non top domain label
    • randomTopLabel

      @NotNull protected static @NotNull String randomTopLabel()
      Returns a random top domain label.
      Returns:
      The top domain label
    • randomHostName

      @NotNull public static @NotNull String randomHostName()
      Returns a random host name.
      Returns:
      The host name
    • randomIp4Address

      @NotNull public static @NotNull String randomIp4Address()
      Returns a random IP4 address.
      Returns:
      The IP4 address
    • randomIp6Piece

      @NotNull protected static @NotNull String randomIp6Piece()
      Returns a random IP6 address piece.
      Returns:
      The random IP6 address piece
    • randomFullIp6Address

      @NotNull public static @NotNull String randomFullIp6Address()
      Returns a random full IP6 address.
      Returns:
      The full IP6 address
    • randomAbbreviatedIp6Address

      @NotNull public static @NotNull String randomAbbreviatedIp6Address()
      Returns a random abbreviated IP6 address.
      Returns:
      The abbreviated IP6 address
    • randomIp6Address

      @NotNull public static @NotNull String randomIp6Address()
      Returns a random IP6 address.
      Returns:
      The IP6 address
    • randomHost

      @NotNull public static @NotNull String randomHost()
      Returns a random host.
      Returns:
      The host part
    • randomPort

      public static int randomPort()
      Returns a random port.
      Returns:
      The port
    • randomOptionalPort

      public static int randomOptionalPort()
      Returns a random optional port.
      Returns:
      The port, or -1
    • randomServerAuthority

      @NotNull public static @NotNull String randomServerAuthority()
      Returns a random server authority part.
      Returns:
      The server authority part
    • randomRegistryBasedNamedAuthority

      @NotNull public static @NotNull String randomRegistryBasedNamedAuthority()
      Returns a random registry based named authority part.
      Returns:
      The registry based named authority part
    • randomAuthority

      @NotNull public static @NotNull String randomAuthority()
      Returns a random authority part.
      Returns:
      The authority part
    • randomPathSegment

      @NotNull protected static @NotNull String randomPathSegment()
      Returns a random path segment.
      Returns:
      The path segment
    • randomAbsolutePath

      @NotNull public static @NotNull String randomAbsolutePath()
      Returns a random absolute path.
      Returns:
      The absolute path
    • randomRelativePath

      @NotNull public static @NotNull String randomRelativePath()
      Returns a random relative path.
      Returns:
      The relative path
    • randomPath

      @NotNull public static @NotNull String randomPath()
      Returns a random path part of an URI. The path can be relative or absolute.
      Returns:
      The path part
    • randomQuery

      @NotNull public static @NotNull String randomQuery()
      Returns a random query part of an URI.
      Returns:
      The query part
    • randomOptionalQuery

      public static String randomOptionalQuery()
      Returns a random optional query part of an URI.
      Returns:
      The query part, or null
    • randomFragment

      @NotNull public static @NotNull String randomFragment()
      Returns a random fragment part of an URI.
      Returns:
      The fragment part
    • randomOptionalFragment

      public static String randomOptionalFragment()
      Returns a random optional fragment part of an URI.
      Returns:
      The fragment part, or null
    • randomRelativeURI

      @NotNull public static @NotNull URI randomRelativeURI()
      Returns a random absolute URI.
      Returns:
      The absolute URI
    • randomAbsoluteURI

      @NotNull public static @NotNull URI randomAbsoluteURI()
      Returns a random absolute URI.
      Returns:
      The absolute URI
    • randomURI

      @NotNull public static @NotNull URI randomURI()
      Returns a random URI (absolute or not).
      Returns:
      The URI