Package api.mpba.rastvdmy.entity.enums
Enum Class CardType
- All Implemented Interfaces:
Serializable
,Comparable<CardType>
,Constable
This enum represents the type of card.
It contains the types: VISA and MASTERCARD.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRepresents a MASTERCARD card type.Represents a VISA card type. -
Method Summary
Modifier and TypeMethodDescriptionstatic CardType
Returns a random CardType.toString()
Returns the type of the card as a string.static CardType
Returns the enum constant of this class with the specified name.static CardType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
VISA
Represents a VISA card type. -
MASTERCARD
Represents a MASTERCARD card type.
-
-
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
-
toString
Returns the type of the card as a string. -
getRandomCardType
Returns a random CardType.- Returns:
- A random card type from the enum values.
-