Package net.datafaker.providers.base
Class Code
Generates codes such as ISBN, gin, ean and others.
For ISBN Rules, see https://en.wikipedia.org/wiki/International_Standard_Book_Number.
- Since:
- 0.8.0
-
Field Summary
Fields inherited from class net.datafaker.providers.base.AbstractProvider
faker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasin()
ean13()
ean8()
gtin13()
gtin8()
imei()
isbn10()
isbn10
(boolean separator) isbn13()
isbn13
(boolean separator) This can be overridden by specifyingcode: isbn_group: "some expression"
in the appropriate yml file.isbnGs1()
This can be overridden by specifyingcode: isbn_gs1: "some expression"
in the appropriate yml file.This can be overridden by specifyingcode: isbn_registrant: "some expression"
in the appropriate yml file.Methods inherited from class net.datafaker.providers.base.AbstractProvider
equals, getFaker, hashCode, loadGenerators, resolve, resolve, toString
-
Constructor Details
-
Code
-
-
Method Details
-
isbnGs1
This can be overridden by specifyingcode: isbn_gs1: "some expression"
in the appropriate yml file.- Returns:
- a GS1 code for an ISBN13, currently is only 978 and 979
-
isbnGroup
This can be overridden by specifyingcode: isbn_group: "some expression"
in the appropriate yml file.- Returns:
- an ISBN group number
-
isbnRegistrant
This can be overridden by specifyingcode: isbn_registrant: "some expression"
in the appropriate yml file.- Returns:
- an ISBN registrant 'element' with separator
-
isbn10
- Returns:
- a valid ISBN10 number with no separators (ex. 9604250590)
-
isbn10
- Parameters:
separator
- true if you want separators returned, false otherwise- Returns:
- a valid ISBN10 number with or without separators (ex. 9604250590, 960-425-059-0)
-
isbn13
- Returns:
- a valid ISBN13 number with no separators (ex. 9789604250590)
-
isbn13
- Parameters:
separator
- true if you want separators returned, false otherwise- Returns:
- a valid ISBN13 number with or without separators (ex. 9789604250590, 978-960-425-059-0)
-
asin
-
imei
-
ean8
-
gtin8
-
gtin13
-
ean13
-