Enum Class CardScheme
- All Implemented Interfaces:
Serializable,Comparable<CardScheme>,Constable
Card Scheme supported for the Transaction
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMasterCard Card Scheme is returned for Mastercard transactionPure Card Scheme is returned for Pure transactionUnknown Card Scheme for illegal transactionVisa Card Scheme is returned for Visa transaction -
Method Summary
Modifier and TypeMethodDescriptionstatic CardSchemederiveCardScheme(String scheme) Derives theCardSchemeenum constant from its string representation.static CardSchemeReturns the enum constant of this class with the specified name.static CardScheme[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MASTERCARD
MasterCard Card Scheme is returned for Mastercard transaction -
VISA
Visa Card Scheme is returned for Visa transaction -
PURE
Pure Card Scheme is returned for Pure transaction -
UNKNOWN
Unknown Card Scheme for illegal transaction
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
deriveCardScheme
Derives theCardSchemeenum constant from its string representation.This method compares the input
schemestring (case-insensitively) against the string values of the known card schemes (MASTERCARD, VISA, PURE). If a match is found, the correspondingCardSchemeenum constant is returned. If the input string does not match any of the known schemes,UNKNOWNis returned.- Parameters:
scheme- The string representation of the card scheme (e.g., "MASTERCARD", "Visa", "pure"). This parameter is case-insensitive. Can benull, in which caseUNKNOWNwill be returned (asnullwill not match any scheme viaequalsIgnoreCase).- Returns:
- The corresponding
CardSchemeenum constant if a match is found; otherwise,UNKNOWN.
-