com.beaglebuddy.id3.pojo

## Class Price

- java.lang.Object
- - com.beaglebuddy.id3.pojo.Price

-     public class Price
      extends java.lang.Object

  An ID3v2.x price consists of a currency and an amount.

  Price Fields
  | Field | Description
  --- | --- | ---
  1. | `Currency` | currency of the price.
  2. | amount | The amount uses the "." character as the decimal point.

  Some examples of a price are:

  - USD0.99
  - EUR1.00
  - GBP0.65

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Price()` default constructor using default values of USD and 0.00 for the currency and amount, respectively.
    `Price(Currency currency, java.lang.String amount)` constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAmount()` get the amount of the price.
    `Currency` | `getCurrency()` get the currency of the price.
    `void` | `setAmount(java.lang.String amount)` set the amount of the price.
    `void` | `setCurrency(Currency currency)` sets the currency of the price.
    `java.lang.String` | `toString()` get a string representation of a price.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Price

          public Price()

      default constructor using default values of USD and 0.00 for the currency and amount, respectively.

    - #### Price

          public Price(Currency currency,
               java.lang.String amount)
                throws java.lang.IllegalArgumentException

      constructor.
      Parameters:
        `currency` - the `ISO-4217 currency code`.
        `amount` - the amount of the price using "." as the decimal point.
      Throws:
        `java.lang.IllegalArgumentException` - if the amount is not a valid amount. That is, if the amount is not in the form "^\d+\.?\d*$"
      See Also:
        `setAmount(String)`

  - ### Method Detail

    - #### getCurrency

          public Currency getCurrency()

      get the currency of the price.
      Returns:
        the `ISO-4217 currency code`.
      See Also:
        `setCurrency(Currency)`

    - #### setCurrency

          public void setCurrency(Currency currency)

      sets the currency of the price.
      Parameters:
        `currency` - the ISO-4217 currency.
      See Also:
        `getCurrency()`

    - #### getAmount

          public java.lang.String getAmount()

      get the amount of the price.
      Returns:
        the amount of the price.
      See Also:
        `setAmount(String)`

    - #### setAmount

          public void setAmount(java.lang.String amount)

      set the amount of the price. The amount must coform to the regular expression: ^\d+\.?\d*$
      This means the amount must start with a digit, followed by an optional decimal point, followed by 0 or more digits.
      .
      Examples of valid amounts include:
      - 1
      - 1.
      - 1.0
      - 1.50
      - 0.50
      Examples of invalid amounts include:
      - +1
      - -1.50
      - .50
      Parameters:
        `amount` - the amount of the price using "." as the decimal point.
      Throws:
        `java.lang.IllegalArgumentException` - if the amount is not a valid amount. That is, if the amount is not in the form "^\d+\.?\d*$"
      See Also:
        `getAmount()`

    - #### toString

          public java.lang.String toString()

      get a string representation of a price.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of a price.