Package net.datafaker.providers.base
Class Internet
- Since:
- 0.8.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
Fields inherited from class net.datafaker.providers.base.AbstractProvider
faker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbotUserAgent
(Internet.BotUserAgent vendor) emailAddress
(String localPart) returns an IPv4 address.Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.image()
image
(int width, int height) returns an IPv4 address in dot separated octets.ipV4Cidr()
Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.ipV6Cidr()
macAddress
(String prefix) Returns a MAC address in the following format: 6-bytes in MM:MM:MM:SS:SS:SS format.password()
password
(boolean includeDigit) password
(int minimumLength, int maximumLength) password
(int minimumLength, int maximumLength, boolean includeUppercase) password
(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial) password
(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial, boolean includeDigit) int
port()
Returns a port number between 0 and 65535safeEmailAddress
(String localPart) slug()
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).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.userAgent
(Internet.UserAgent userAgent) uuid()
Returns a UUID (type 4) as String.uuidv3()
Returns a UUID (type 3) as String.Returns a web domain.
-
Field Details
-
DIACRITICS_AND_FRIENDS
-
-
Constructor Details
-
Internet
-
-
Method Details
-
emailAddress
-
emailAddress
-
safeEmailAddress
-
safeEmailAddress
-
domainName
-
domainWord
-
domainSuffix
-
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 httpsportChoice
- if true a random port will be included, if false no port will be includedpathChoice
- if true two random path elements will be included, if false no path elements will be includedfileChoice
- if true the path will end with a random word element instead of a slash, if false it will end with a slashparamsChoice
- if true two random name value pairs will be included, if false no params will be includedanchorChoice
- if true a random anchor will be included, if false no anchor will be included- Returns:
- a web URL
- Since:
- 2.0.0
-
webdomain
Returns a web domain.- Returns:
- a web domain in the form "www.example.com"
- Since:
- 2.0.0
-
image
-
image
-
image
-
httpMethod
-
password
-
password
-
password
-
password
-
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
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
- See Also:
-
ipV4Address
returns an IPv4 address in dot separated octets.- Returns:
- a correctly formatted IPv4 address.
-
getIpV4Address
returns an IPv4 address.- Returns:
- an IPv4 address.
- Throws:
UnknownHostException
-
privateIpV4Address
- Returns:
- a valid private IPV4 address in dot notation
-
getPrivateIpV4Address
- Returns:
- a private IPV4 address
- Throws:
UnknownHostException
-
publicIpV4Address
- Returns:
- a valid public IPV4 address in dot notation
-
getPublicIpV4Address
- Returns:
- a valid public IPV4 address
- Throws:
UnknownHostException
-
ipV4Cidr
- Returns:
- a valid IPV4 CIDR
-
ipV6Address
Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.
- Returns:
- a correctly formatted IPv6 address.
-
getIpV6Address
Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.
- Returns:
- a IPV6 address.
- Throws:
UnknownHostException
-
ipV6Cidr
- Returns:
- a valid IPV6 CIDR
-
slug
- Returns:
- a slug using '_' as the word separator and two
Lorem
words as the values
-
slug
- Parameters:
wordsOrNull
- if null, then 2Lorem
wordsglueOrNull
- if null, "_"- Returns:
- a slug string combining wordsOrNull with glueOrNull (ex. x_y)
-
uuidv3
Returns a UUID (type 3) as String. Use this method (instead ofuuid
) if you are using a constant random seed and require the same output for different faker instances. *- Returns:
- a uuid as 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
-
userAgent
-
botUserAgent
-
botUserAgentAny
-