Enum Class Currency

java.lang.Object
java.lang.Enum<Currency>
api.mpba.rastvdmy.entity.enums.Currency
All Implemented Interfaces:
Serializable, Comparable<Currency>, Constable

public enum Currency extends Enum<Currency>
This enum represents the currency types. It contains the types: CZK, USD, EUR, PLN, and UAH.
  • Enum Constant Details

    • CZK

      public static final Currency CZK
      Represents the Czech koruna currency type.
    • USD

      public static final Currency USD
      Represents the United States dollar currency type.
    • EUR

      public static final Currency EUR
      Represents the Euro currency type.
    • PLN

      public static final Currency PLN
      Represents the Polish złoty currency type.
    • UAH

      public static final Currency UAH
      Represents the Ukrainian hryvnia currency type.
  • Method Details

    • values

      public static Currency[] 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 Currency 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
    • toString

      public String toString()
      Returns the type of the currency as a string.
      Overrides:
      toString in class Enum<Currency>
      Returns:
      The type of the currency.
    • getRandomCurrency

      public static Currency getRandomCurrency()
      Returns a random Currency.
      Returns:
      A random currency from the enum values.