Class Currencies

java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<String,String>
net.thauvin.erik.frankfurter.models.Currencies
All Implemented Interfaces:
Serializable, ConcurrentMap<String,String>, Map<String,String>

public class Currencies extends ConcurrentHashMap<String,String>
Represents a map of available currency symbols to their full names.
See Also:
  • Constructor Details

    • Currencies

      public Currencies()
  • Method Details

    • getFullNameFor

      public String getFullNameFor(String symbol)
      Retrieves the full name of a currency by its symbol.
      Parameters:
      symbol - The currency symbol
      Returns:
      The full name of the currency, or null if the symbol doesn't exist
    • getSymbolFor

      public String getSymbolFor(String name)
      Retrieves the currency symbol corresponding to the given currency name.
      Parameters:
      name - The full name of the currency for which the symbol is to be retrieved
      Returns:
      The symbol of the currency if the name matches an entry, or null if no match is found
    • getSymbolFor

      public String getSymbolFor(Pattern regexPattern)
      Retrieves the currency symbol corresponding to a currency name that matches the given regular expression pattern.
      Parameters:
      regexPattern - The pattern used to match currency names
      Returns:
      The symbol of the currency if a matching name is found, or null if no match is found or if the pattern is null.