Package net.datafaker
Class Internet
java.lang.Object
net.datafaker.Internet
- Since:
- 0.8.0
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionavatar()
Deprecated.use faker.avatar.image() insteademailAddress
(String localPart) returns an IPv4 address.Returns an IPv6 address in hh:hh:hh:hh:hh:hh:hh:hh format.image()
Generates a random image url based on the lorempixel service.Same as image() but allows client code to choose a few image characteristicsreturns 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) safeEmailAddress
(String localPart) slug()
url()
userAgent
(Internet.UserAgent userAgent) uuid()
Returns a UUID (type 4) as String.
-
Field Details
-
DIACRITICS_AND_FRIENDS
-
-
Constructor Details
-
Internet
-
-
Method Details
-
emailAddress
-
emailAddress
-
safeEmailAddress
-
safeEmailAddress
-
domainName
-
domainWord
-
domainSuffix
-
url
-
avatar
Deprecated.use faker.avatar.image() instead -
image
Generates a random image url based on the lorempixel service. All the images provided by this service are released under the creative commons license (CC BY-SA). For more information, please visit: http://lorempixel.com/- Returns:
- an url to a random image.
- See Also:
-
image
Same as image() but allows client code to choose a few image characteristics- Parameters:
width
- the image widthheight
- the image heightgray
- true for gray image and false for color imagetext
- optional custom text on the selected picture- Returns:
- an url to a random image with the given characteristics.
-
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) -
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)
-
uuid
Returns a UUID (type 4) as String.- Returns:
- A UUID as String.
-
userAgent
-
userAgentAny
-