Package net.datafaker.providers.base
Class Internet
- Since:
- 0.8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enum -
Field Summary
FieldsFields inherited from class net.datafaker.providers.base.AbstractProvider
faker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbotUserAgent(Internet.BotUserAgent vendor) emailAddress(String name) Returns an email address based on the provided name and a random domain (from "internet.free_email").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()Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0.password(boolean includeDigit) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0.password(int minimumLength, int maximumLength) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0.password(int minimumLength, int maximumLength, boolean includeUppercase) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0.password(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0.password(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial, boolean includeDigit) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0.intport()Returns a port number between 0 and 65535intport(int from, int to) Returns a port number betweenfromandto(inclusive)intport(Internet.PortRange range) Returns a port number within given rangesafeEmailAddress(String name) Returns an email address based on the provided name and a safe domain (from "internet.safe_email").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) username()Deprecated, for removal: This API element is subject to removal in a future version.Since 2.5.0.uuid()Returns a UUID (type 4) as String.uuidv3()Returns a UUID (type 3) as String.uuidv4()uuidv7()Returns a web domain.Methods inherited from class net.datafaker.providers.base.AbstractProvider
equals, getFaker, hashCode, loadGenerators, resolve, resolve, toString
-
Field Details
-
DIACRITICS_AND_FRIENDS
-
-
Constructor Details
-
Internet
-
-
Method Details
-
username
Deprecated, for removal: This API element is subject to removal in a future version.Since 2.5.0. UseCredentials.username()instead.A lowercase username composed of the first_name and last_name joined with a '.'. Some examples are:- (template)
Name.firstName().Name.lastName() - jim.jones
- jason.leigh
- tracy.jordan
- Returns:
- a random two part username.
- See Also:
- (template)
-
emailAddress
-
emailAddress
Returns an email address based on the provided name and a random domain (from "internet.free_email").Example usage:
faker.internet().emailAddress("Hal")); // hal@gmail.com faker.internet().emailAddress("John McClane")); // john.mcclane@yahoo.com faker.internet().emailAddress("Stephen Vincent Strange")); // stephen.strange@hotmail.com faker.internet().emailAddress("Dr. Henry Indiana Jones Jr.")); // henry.jones@gmail.com faker.internet().emailAddress("Jeanne d'Arc")); // jeanne.darc@yahoo.com- Parameters:
name- The name to be used for generating the local part of the email address.- Returns:
- A String representing an email address.
- See Also:
-
safeEmailAddress
-
safeEmailAddress
Returns an email address based on the provided name and a safe domain (from "internet.safe_email").faker.internet().safeEmailAddress("John McClane")); // john.mcclane@example.com- Parameters:
name- The name to be used for generating the local part of the email address.- Returns:
- A String representing an email address.
- See Also:
-
emailSubject
-
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
Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0. UseCredentials.password()instead. -
password
Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0. UseCredentials.password(boolean)instead. -
password
@Deprecated(since="2.5.0", forRemoval=true) public String password(int minimumLength, int maximumLength) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0. UseCredentials.password(int, int)instead. -
password
@Deprecated(since="2.5.0", forRemoval=true) public String password(int minimumLength, int maximumLength, boolean includeUppercase) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0. UseCredentials.password(int, int, boolean)instead. -
password
@Deprecated(since="2.5.0", forRemoval=true) public String password(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0. UseCredentials.password(int, int, boolean, boolean)instead. -
password
@Deprecated(since="2.5.0", forRemoval=true) public String password(int minimumLength, int maximumLength, boolean includeUppercase, boolean includeSpecial, boolean includeDigit) Deprecated, for removal: This API element is subject to removal in a future version.since 2.5.0. UseCredentials.password(int, int, boolean, boolean, boolean)instead. -
port
public int port()Returns a port number between 0 and 65535- Returns:
- a port number
-
port
Returns a port number within given range- Parameters:
range- either Well-Known Ports (0-1023), Registered Ports (1024-49151) or Dynamic/Private Ports (49152-65535)- Returns:
- a port number
-
port
public int port(int from, int to) Returns a port number betweenfromandto(inclusive)- Parameters:
from- minimum port number (must not be less than 0)to- maximum port number (must not be greater than 65535)- Returns:
- a port number within given range
-
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.
-
privateIpV4Address
- Returns:
- a valid private IPV4 address in dot notation
-
getPrivateIpV4Address
- Returns:
- a private IPV4 address
-
publicIpV4Address
- Returns:
- a valid public IPV4 address in dot notation
-
getPublicIpV4Address
- Returns:
- a valid public IPV4 address
-
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.
-
ipV6Cidr
- Returns:
- a valid IPV6 CIDR
-
slug
- Returns:
- a slug using '_' as the word separator and two
Loremwords as the values
-
slug
- Parameters:
wordsOrNull- if null, then 2LoremwordsglueOrNull- 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.
-
uuidv4
-
uuidv7
-
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
-