Class Amount


  • public class Amount
    extends Object
    Amount
    • Constructor Summary

      Constructors 
      Constructor Description
      Amount()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Amount currency​(String currency)
      The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
      boolean equals​(Object o)
      Return true if this Amount object is equal to o.
      static Amount fromJson​(String jsonString)
      Create an instance of Amount given an JSON string
      String getCurrency()
      The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
      Long getValue()
      The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
      int hashCode()  
      void setCurrency​(String currency)
      The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
      void setValue​(Long value)
      The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
      String toJson()
      Convert an instance of Amount to an JSON string
      String toString()  
      Amount value​(Long value)
      The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
    • Constructor Detail

      • Amount

        public Amount()
    • Method Detail

      • currency

        public Amount currency​(String currency)
        The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
        Parameters:
        currency - The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
        Returns:
        the current Amount instance, allowing for method chaining
      • getCurrency

        public String getCurrency()
        The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
        Returns:
        currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
      • setCurrency

        public void setCurrency​(String currency)
        The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
        Parameters:
        currency - The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
      • value

        public Amount value​(Long value)
        The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
        Parameters:
        value - The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
        Returns:
        the current Amount instance, allowing for method chaining
      • getValue

        public Long getValue()
        The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
        Returns:
        value The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
      • setValue

        public void setValue​(Long value)
        The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
        Parameters:
        value - The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
      • equals

        public boolean equals​(Object o)
        Return true if this Amount object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • fromJson

        public static Amount fromJson​(String jsonString)
                               throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of Amount given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of Amount
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to Amount
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of Amount to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException