Enum Class BloodGroup

java.lang.Object
java.lang.Enum<BloodGroup>
de.powerstat.validation.values.BloodGroup
All Implemented Interfaces:
IValueObject, Serializable, Comparable<BloodGroup>, Constable

public enum BloodGroup extends Enum<BloodGroup> implements IValueObject
Blood group AB0 rhesus system.
See Also:
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • BloodGroup

      private BloodGroup(int action)
      Ordinal constructor.
      Parameters:
      action - Action number
  • Method Details

    • values

      public static BloodGroup[] 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

      public static BloodGroup valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • of

      public static BloodGroup of(String value)
      BloodGroup factory.
      Parameters:
      value - Enum name string
      Returns:
      BloodGroup enum
    • getAction

      public int getAction()
      Get action number.
      Returns:
      Action number
    • stringValue

      public String stringValue()
      Returns the value of this BloodGroup as a string.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The text value represented by this object after conversion to type string.
    • couldDonateTo

      public boolean couldDonateTo(BloodGroup other)
      Could donate blood to other blood group.
      Parameters:
      other - Other blood group to donate to
      Returns:
      true: possible; false: not possible
    • couldReceiveFrom

      public boolean couldReceiveFrom(BloodGroup other)
      Could receive blood from other blood group.
      Parameters:
      other - Other blood group to receive from
      Returns:
      true: possible; false: not possible