Class Internet


public class Internet extends AbstractProvider<BaseProviders>
Since:
0.8.0
  • Field Details

    • DIACRITICS_AND_FRIENDS

      public static final Pattern DIACRITICS_AND_FRIENDS
  • Constructor Details

  • Method Details

    • username

      public String username()
      A lowercase username composed of the first_name and last_name joined with a '.'. Some examples are:
      Returns:
      a random two part username.
      See Also:
    • emailAddress

      public String emailAddress()
    • emailAddress

      public String emailAddress(String localPart)
    • safeEmailAddress

      public String safeEmailAddress()
    • safeEmailAddress

      public String safeEmailAddress(String localPart)
    • emailSubject

      public String emailSubject()
    • domainName

      public String domainName()
    • domainWord

      public String domainWord()
    • domainSuffix

      public String domainSuffix()
    • url

      public String url()
      Returns a string representing a web URL, randomly including: http/https scheme, port, path elements (2 or none), file element (1 or none), params (2 or none), anchor (1 or none).
      Returns:
      a web URL
      Since:
      2.0.0
    • url

      public String url(boolean schemeChoice, boolean portChoice, boolean pathChoice, boolean fileChoice, boolean paramsChoice, boolean anchorChoice)
      Returns a string representing a web URL, with various elements controlled by the caller.
      Parameters:
      schemeChoice - if true will be random http or https, if false will be https
      portChoice - if true a random port will be included, if false no port will be included
      pathChoice - if true two random path elements will be included, if false no path elements will be included
      fileChoice - if true the path will end with a random word element instead of a slash, if false it will end with a slash
      paramsChoice - if true two random name value pairs will be included, if false no params will be included
      anchorChoice - if true a random anchor will be included, if false no anchor will be included
      Returns:
      a web URL
      Since:
      2.0.0
    • webdomain

      public String webdomain()
      Returns a web domain.
      Returns:
      a web domain in the form "www.example.com"
      Since:
      2.0.0
    • image

      public String image()
    • image

      public String image(int width, int height)
    • image

      public String image(int width, int height, String seed)
    • httpMethod

      public String httpMethod()
    • password

      public String password()
    • password

      public String password(boolean includeDigit)
    • password

      public String password(int minimumLength, int maximumLength)
    • password

      public String password(int minimumLength, int maximumLength, boolean includeUppercase)
    • password

      public String password(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial)
    • password

      public String password(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial, boolean includeDigit)
    • port

      public int port()
      Returns a port number between 0 and 65535
      Returns:
      a port number
    • macAddress

      public String macAddress(String prefix)

      Returns a MAC address in the following format: 6-bytes in MM:MM:MM:SS:SS:SS format.

      Parameters:
      prefix - a prefix to put on the front of the address
      Returns:
      a correctly formatted MAC address
    • macAddress

      public String macAddress()
      See Also:
    • ipV4Address

      public String ipV4Address()
      returns an IPv4 address in dot separated octets.
      Returns:
      a correctly formatted IPv4 address.
    • getIpV4Address

      public InetAddress getIpV4Address() throws UnknownHostException
      returns an IPv4 address.
      Returns:
      an IPv4 address.
      Throws:
      UnknownHostException
    • privateIpV4Address

      public String privateIpV4Address()
      Returns:
      a valid private IPV4 address in dot notation
    • getPrivateIpV4Address

      public InetAddress getPrivateIpV4Address() throws UnknownHostException
      Returns:
      a private IPV4 address
      Throws:
      UnknownHostException
    • publicIpV4Address

      public String publicIpV4Address()
      Returns:
      a valid public IPV4 address in dot notation
    • getPublicIpV4Address

      public InetAddress getPublicIpV4Address() throws UnknownHostException
      Returns:
      a valid public IPV4 address
      Throws:
      UnknownHostException
    • ipV4Cidr

      public String ipV4Cidr()
      Returns:
      a valid IPV4 CIDR
    • ipV6Address

      public String ipV6Address()

      Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.

      Returns:
      a correctly formatted IPv6 address.
    • getIpV6Address

      public InetAddress getIpV6Address() throws UnknownHostException

      Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.

      Returns:
      a IPV6 address.
      Throws:
      UnknownHostException
    • ipV6Cidr

      public String ipV6Cidr()
      Returns:
      a valid IPV6 CIDR
    • slug

      public String slug()
      Returns:
      a slug using '_' as the word separator and two Lorem words as the values
    • slug

      public String slug(List<String> wordsOrNull, String glueOrNull)
      Parameters:
      wordsOrNull - if null, then 2 Lorem words
      glueOrNull - if null, "_"
      Returns:
      a slug string combining wordsOrNull with glueOrNull (ex. x_y)
    • uuidv3

      public String uuidv3()
      Returns a UUID (type 3) as String. Use this method (instead of uuid) if you are using a constant random seed and require the same output for different faker instances. *
      Returns:
      a uuid as string.
    • uuid

      public String uuid()
      Returns a UUID (type 4) as String.

      This returns a repeatable version of a version 4 UUID, which is a bit against the idea of a version 4 UUID, but this is a faker library, not a UUID library.

      Returns:
      a v4 uuid as string.
    • userAgent

      public String userAgent(Internet.UserAgent userAgent)
    • userAgent

      public String userAgent()
    • botUserAgent

      public String botUserAgent(Internet.BotUserAgent vendor)
    • botUserAgentAny

      public String botUserAgentAny()