Class CurrencyDTO

    • Constructor Detail

      • CurrencyDTO

        public CurrencyDTO​(String newCode)
        Constructor.
        Parameters:
        newCode - currency code
      • CurrencyDTO

        public CurrencyDTO​(CurrencyDTO.Builder builder)
        Builder.
        Parameters:
        builder - builder
    • Method Detail

      • getAvailableCurrencies

        public static SortedSet<CurrencyDTO> getAvailableCurrencies()
        Gets the set of available currencies.
        Returns:
        available currencies
      • getAvailableCurrencyCodes

        public static SortedSet<String> getAvailableCurrencyCodes()
        Gets the set of available currency codes.
        Returns:
        currency codes
      • getInstance

        public static CurrencyDTO getInstance​(String currencyCode)
        Returns a Currency instance for the given currency code.
        Parameters:
        currencyCode - currency code
        Returns:
        currency
      • getInstanceNoCreate

        public static CurrencyDTO getInstanceNoCreate​(String currencyCode)
        Returns a Currency instance for the given currency code.
        Parameters:
        currencyCode - currency code
        Returns:
        currency
      • getCurrencyCode

        public String getCurrencyCode()
        Get currency code.
        Returns:
        currency code
      • getCodeCurrency

        public CurrencyDTO getCodeCurrency​(String newCode)
        Gets the equivalent object with the passed code.

        This is useful in case some currencies share codes, such that getInstance(String) may return the wrong currency.

        Parameters:
        newCode - The code the returned object will evaluate to
        Returns:
        A Currency representing the same currency but having the passed currency code
      • getIso4217Currency

        public CurrencyDTO getIso4217Currency()
        Gets the equivalent object with an ISO 4217 code, or if none a code which looks ISO compatible (starts with an X), or the constructed currency code if neither exist.
        Returns:
        currency
      • getCommonlyUsedCurrency

        public CurrencyDTO getCommonlyUsedCurrency()
        Gets the equivalent object that was created with the "commonly used" code.
        Returns:
        currency
      • getCurrencyCodes

        public Set<String> getCurrencyCodes()
        Gets the set of all currency codes associated with this currency.
        Returns:
        currency
      • getSymbol

        public String getSymbol()
        Gets the unicode symbol of this currency.
        Returns:
        unicode
      • getCode

        public String getCode()
        Getter for code.
        Returns:
        code
      • getDisplayName

        public String getDisplayName()
        Gets the name that is suitable for displaying this currency.
        Returns:
        display name
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object