- All Implemented Interfaces:
IValueObject
,Serializable
,Comparable<BloodGroup>
,Constable
Blood group AB0 rhesus system.
- See Also:
-
- Blutgruppe Not DSGVO relevant.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Action number.private static final Map<BloodGroup,
List<BloodGroup>> Donate to other blood group.private static final Map<BloodGroup,
List<BloodGroup>> Receive from other blood group. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
couldDonateTo
(BloodGroup other) Could donate blood to other blood group.boolean
couldReceiveFrom
(BloodGroup other) Could receive blood from other blood group.int
Get action number.static BloodGroup
BloodGroup factory.Returns the value of this BloodGroup as a string.static BloodGroup
Returns the enum constant of this class with the specified name.static BloodGroup[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ON
0-. -
OP
0+. -
AN
A-. -
AP
A+. -
BN
B-. -
BP
B+. -
ABN
AB-. -
ABP
AB+.
-
-
Field Details
-
DONATE_TO
Donate to other blood group. -
RECEIVE_FROM
Receive from other blood group. -
action
private final int actionAction number.
-
-
Constructor Details
-
BloodGroup
private BloodGroup(int action) Ordinal constructor.- Parameters:
action
- Action number
-
-
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
-
of
BloodGroup factory.- Parameters:
value
- Enum name string- Returns:
- BloodGroup enum
-
getAction
public int getAction()Get action number.- Returns:
- Action number
-
stringValue
Returns the value of this BloodGroup as a string.- Specified by:
stringValue
in interfaceIValueObject
- Returns:
- The text value represented by this object after conversion to type string.
-
couldDonateTo
Could donate blood to other blood group.- Parameters:
other
- Other blood group to donate to- Returns:
- true: possible; false: not possible
-
couldReceiveFrom
Could receive blood from other blood group.- Parameters:
other
- Other blood group to receive from- Returns:
- true: possible; false: not possible
-