Class CreditCards
- All Implemented Interfaces:
MockUnit<java.lang.String>,MockUnitString
public class CreditCards extends MockUnitBase implements MockUnitString
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedCreditCards()CreditCards(MockNeat mockNeat) -
Method Summary
Modifier and Type Method Description MockUnitStringamex()Returns a newMockUnitStringthat is used to generate credit card numbers of typeAMERICAN_EXPRESS.static CreditCardscreditCards()Returns aCreditCardsobject that can be used to generate valid Credit Card numbers.MockUnitStringcustom(int length, java.lang.Integer... prefix)Returns a newMockUnitStringthat is used to generate custom credit card numbers with a given length and prefix.MockUnitStringmasterCard()Returns a newMockUnitStringthat is used to generate credit card numbers of typeMASTERCARD.MockUnitStringnames()Returns a newMockUnitStringthat is used to generate credit card names (not numbers).java.util.function.Supplier<java.lang.String>supplier()This is the sole abstract method of the interface.MockUnitStringtype(CreditCardType type)Returns a newMockUnitStringthat is used to generate credit card numbers of a given type:CreditCardType.MockUnitStringtypes(CreditCardType... types)Returns a newMockUnitStringthat is used to generate credit card numbers from the giventypes:CreditCardType.MockUnitStringvisa()Returns a newMockUnitStringthat is used to generate credit card numbers of typeVISA_16.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStrMethods inherited from interface net.andreinc.mockneat.abstraction.MockUnitString
accumulate, append, array, base64, escapeCsv, escapeEcmaScript, escapeHtml, escapeXml, format, md2, md5, noSpecialChars, prepend, replace, replace, replaceAll, replaceFirst, sha1, sha256, sha384, sha512, split, split, sub, sub, urlEncode, urlEncode
-
Constructor Details
-
CreditCards
protected CreditCards() -
CreditCards
-
-
Method Details
-
creditCards
Returns a
CreditCardsobject that can be used to generate valid Credit Card numbers.Note: By default it generates AMERICAN_EXPRESS valid credit card numbers.
Note: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Returns:
- A re-usable
CreditCardsinstance. The class implementsMockUnitString.
-
supplier
public java.util.function.Supplier<java.lang.String> supplier()Description copied from interface:MockUnitThis is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented. -
names
Returns a newMockUnitStringthat is used to generate credit card names (not numbers). (Eg.: "Mastercard")- Returns:
- A new
MockUnitString.
-
type
Returns a newMockUnitStringthat is used to generate credit card numbers of a given type:CreditCardType.Note: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Parameters:
type- The type of the generated credit card number.- Returns:
- A new
MockUnitString
-
custom
Returns a newMockUnitStringthat is used to generate custom credit card numbers with a given length and prefix.Note: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Parameters:
length- The length of the credit card number.prefix- The prefix- Returns:
- A new
MockUnitString
-
types
Returns a newMockUnitStringthat is used to generate credit card numbers from the giventypes:CreditCardType.Note: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Parameters:
types- A var-arg array that contains the types of the desired credit card numbers.- Returns:
- A new
MockUnitString
-
amex
Returns a newMockUnitStringthat is used to generate credit card numbers of typeAMERICAN_EXPRESS.Note: This is a shortcut method for:
mockNeat.creditCards().type(AMERICAN_EXPRESSNote: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Returns:
- A new
MockUnitString.
-
visa
Returns a newMockUnitStringthat is used to generate credit card numbers of typeVISA_16.Note: This is a shortcut method for:
mockNeat.creditCards().type(VISA_16Note: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Returns:
- A new
MockUnitString.
-
masterCard
Returns a newMockUnitStringthat is used to generate credit card numbers of typeMASTERCARD.Note: This is a shortcut method for:
mockNeat.creditCards().type(MASTERCARDNote: Credit card numbers are financial information. The values are generated at random so don't use them in real-life scenarios.
- Returns:
- A new
MockUnitString
-